Cleanup
This commit is contained in:
parent
8b190d776a
commit
3d77083aa7
4 changed files with 3 additions and 6 deletions
|
|
@ -35,8 +35,6 @@ data class NotificationData(
|
||||||
)
|
)
|
||||||
|
|
||||||
data class NotificationEvent(
|
data class NotificationEvent(
|
||||||
val eventId: EventId,
|
|
||||||
val senderId: UserId,
|
|
||||||
val timestamp: Long,
|
val timestamp: Long,
|
||||||
val content: String,
|
val content: String,
|
||||||
// For images for instance
|
// For images for instance
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@ class TimelineEventMapper @Inject constructor() {
|
||||||
fun map(timelineEvent: TimelineEvent): NotificationEvent {
|
fun map(timelineEvent: TimelineEvent): NotificationEvent {
|
||||||
return timelineEvent.use {
|
return timelineEvent.use {
|
||||||
NotificationEvent(
|
NotificationEvent(
|
||||||
eventId = EventId(it.eventId()),
|
|
||||||
senderId = UserId(it.senderId()),
|
|
||||||
timestamp = it.timestamp().toLong(),
|
timestamp = it.timestamp().toLong(),
|
||||||
content = it.eventType().toContent(),
|
content = it.eventType().toContent(),
|
||||||
contentUrl = null // TODO it.eventType().toContentUrl(),
|
contentUrl = null // TODO it.eventType().toContentUrl(),
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,6 @@ private fun NotificationData?.orDefault(roomId: RoomId, eventId: EventId): Notif
|
||||||
isEncrypted = false,
|
isEncrypted = false,
|
||||||
isDirect = false,
|
isDirect = false,
|
||||||
event = NotificationEvent(
|
event = NotificationEvent(
|
||||||
eventId = eventId,
|
|
||||||
senderId = UserId("@user:domain"),
|
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
content = "Message ${eventId.value.take(8)}… in room ${roomId.value.take(8)}…",
|
content = "Message ${eventId.value.take(8)}… in room ${roomId.value.take(8)}…",
|
||||||
contentUrl = null
|
contentUrl = null
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ data class NotifiableMessageEvent(
|
||||||
val description: String = body ?: ""
|
val description: String = body ?: ""
|
||||||
val title: String = senderName ?: ""
|
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?
|
val imageUri: Uri?
|
||||||
get() = imageUriString?.let { Uri.parse(it) }
|
get() = imageUriString?.let { Uri.parse(it) }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue