Cleanup
This commit is contained in:
parent
183dd153ff
commit
685b034977
4 changed files with 3 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue