This commit is contained in:
Benoit Marty
2023-05-24 17:32:33 +02:00
committed by Benoit Marty
parent 8b190d776a
commit 3d77083aa7
4 changed files with 3 additions and 6 deletions

View File

@@ -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

View File

@@ -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(),

View File

@@ -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

View File

@@ -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) }
}