fix: Fix self-replies after receiving another message

If the order of events is

- 1 or more messages received
- 1 reply
- 1 message received,

then the self-reply will be grouped together with the message
above it.
This commit is contained in:
PapaTutuWawa 2023-07-30 22:28:16 +02:00
parent 2f5a39416b
commit 79938aa177

View File

@ -162,7 +162,12 @@ fun showMessagingNotification(context: Context, notification: Api.MessagingNotif
val message = notification.messages[i] val message = notification.messages[i]
// Build the sender // Build the sender
val sender = Person.Builder().apply { // NOTE: Note that we set it to null if message.sender == null because otherwise this results in
// a bogus Person object which messes with the "self-message" display as Android expects
// null in that case.
val sender = if (message.sender == null)
null
else Person.Builder().apply {
setName(message.sender) setName(message.sender)
setKey(message.jid) setKey(message.jid)