Merge pull request #6183 from SpiritCroc/persist-image-notification
Fix some notifications never getting dismissed
This commit is contained in:
commit
bd2cd3ad96
|
@ -0,0 +1 @@
|
||||||
|
Fix some notifications not clearing when read
|
|
@ -151,7 +151,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
senderName = senderDisplayName,
|
senderName = senderDisplayName,
|
||||||
senderId = event.root.senderId,
|
senderId = event.root.senderId,
|
||||||
body = body.toString(),
|
body = body.toString(),
|
||||||
imageUri = event.fetchImageIfPresent(session),
|
imageUriString = event.fetchImageIfPresent(session)?.toString(),
|
||||||
roomId = event.root.roomId!!,
|
roomId = event.root.roomId!!,
|
||||||
roomName = roomName,
|
roomName = roomName,
|
||||||
matrixID = session.myUserId
|
matrixID = session.myUserId
|
||||||
|
@ -176,7 +176,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
senderName = senderDisplayName,
|
senderName = senderDisplayName,
|
||||||
senderId = event.root.senderId,
|
senderId = event.root.senderId,
|
||||||
body = body,
|
body = body,
|
||||||
imageUri = event.fetchImageIfPresent(session),
|
imageUriString = event.fetchImageIfPresent(session)?.toString(),
|
||||||
roomId = event.root.roomId!!,
|
roomId = event.root.roomId!!,
|
||||||
roomName = roomName,
|
roomName = roomName,
|
||||||
roomIsDirect = room.roomSummary()?.isDirect ?: false,
|
roomIsDirect = room.roomSummary()?.isDirect ?: false,
|
||||||
|
|
|
@ -27,7 +27,9 @@ data class NotifiableMessageEvent(
|
||||||
val senderName: String?,
|
val senderName: String?,
|
||||||
val senderId: String?,
|
val senderId: String?,
|
||||||
val body: String?,
|
val body: String?,
|
||||||
val imageUri: Uri?,
|
// We cannot use Uri? type here, as that could trigger a
|
||||||
|
// NotSerializableException when persisting this to storage
|
||||||
|
val imageUriString: String?,
|
||||||
val roomId: String,
|
val roomId: String,
|
||||||
val roomName: String?,
|
val roomName: String?,
|
||||||
val roomIsDirect: Boolean = false,
|
val roomIsDirect: Boolean = false,
|
||||||
|
@ -45,4 +47,7 @@ data class NotifiableMessageEvent(
|
||||||
val type: String = EventType.MESSAGE
|
val type: String = EventType.MESSAGE
|
||||||
val description: String = body ?: ""
|
val description: String = body ?: ""
|
||||||
val title: String = senderName ?: ""
|
val title: String = senderName ?: ""
|
||||||
|
|
||||||
|
val imageUri: Uri?
|
||||||
|
get() = imageUriString?.let { Uri.parse(it) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
||||||
?: context?.getString(R.string.notification_sender_me),
|
?: context?.getString(R.string.notification_sender_me),
|
||||||
senderId = session.myUserId,
|
senderId = session.myUserId,
|
||||||
body = message,
|
body = message,
|
||||||
imageUri = null,
|
imageUriString = null,
|
||||||
roomId = room.roomId,
|
roomId = room.roomId,
|
||||||
roomName = room.roomSummary()?.displayName ?: room.roomId,
|
roomName = room.roomSummary()?.displayName ?: room.roomId,
|
||||||
roomIsDirect = room.roomSummary()?.isDirect == true,
|
roomIsDirect = room.roomSummary()?.isDirect == true,
|
||||||
|
|
|
@ -77,5 +77,5 @@ fun aNotifiableMessageEvent(
|
||||||
roomIsDirect = false,
|
roomIsDirect = false,
|
||||||
canBeReplaced = false,
|
canBeReplaced = false,
|
||||||
isRedacted = isRedacted,
|
isRedacted = isRedacted,
|
||||||
imageUri = null
|
imageUriString = null
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue