Browse Source

Cleanup

feature/fga/small_timeline_improvements
Benoit Marty 1 year ago committed by Benoit Marty
parent
commit
685b034977
  1. 2
      libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/notification/NotificationData.kt
  2. 2
      libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/notification/TimelineEventMapper.kt
  3. 2
      libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotifiableEventResolver.kt
  4. 3
      libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/model/NotifiableMessageEvent.kt

2
libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/notification/NotificationData.kt

@ -35,8 +35,6 @@ data class NotificationData( @@ -35,8 +35,6 @@ data class NotificationData(
)
data class NotificationEvent(
val eventId: EventId,
val senderId: UserId,
val timestamp: Long,
val content: String,
// For images for instance

2
libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/notification/TimelineEventMapper.kt

@ -32,8 +32,6 @@ class TimelineEventMapper @Inject constructor() { @@ -32,8 +32,6 @@ class TimelineEventMapper @Inject constructor() {
fun map(timelineEvent: TimelineEvent): NotificationEvent {
return timelineEvent.use {
NotificationEvent(
eventId = EventId(it.eventId()),
senderId = UserId(it.senderId()),
timestamp = it.timestamp().toLong(),
content = it.eventType().toContent(),
contentUrl = null // TODO it.eventType().toContentUrl(),

2
libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/NotifiableEventResolver.kt

@ -114,8 +114,6 @@ private fun NotificationData?.orDefault(roomId: RoomId, eventId: EventId): Notif @@ -114,8 +114,6 @@ private fun NotificationData?.orDefault(roomId: RoomId, eventId: EventId): Notif
isEncrypted = false,
isDirect = false,
event = NotificationEvent(
eventId = eventId,
senderId = UserId("@user:domain"),
timestamp = System.currentTimeMillis(),
content = "Message ${eventId.value.take(8)}… in room ${roomId.value.take(8)}",
contentUrl = null

3
libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/model/NotifiableMessageEvent.kt

@ -57,6 +57,9 @@ data class NotifiableMessageEvent( @@ -57,6 +57,9 @@ data class NotifiableMessageEvent(
val description: String = body ?: ""
val title: String = senderName ?: ""
// TODO EAx The image has to be downloaded and expose using the file provider.
// Example of value from Element Android:
// content://im.vector.app.debug.mx-sdk.fileprovider/downloads/downloads/816abf76d806c768760568952b1862c8/F/72c33edd23dee3b95f4d5a18aa25fa54/image.png
val imageUri: Uri?
get() = imageUriString?.let { Uri.parse(it) }
}

Loading…
Cancel
Save