Fix / try to get edited message content first

This commit is contained in:
Valere 2019-06-24 14:35:43 +02:00 committed by Benoit Marty
parent 1feb1f9c3f
commit abb1c3f3c4

View File

@ -118,7 +118,8 @@ class NotifiableEventResolver(val stringProvider: StringProvider,
notifiableEvent.matrixID = session.sessionParams.credentials.userId notifiableEvent.matrixID = session.sessionParams.credentials.userId
return notifiableEvent return notifiableEvent
} else { } else {
val body = event.root.getClearContent().toModel<MessageContent>()?.body val body = event.annotations?.editSummary?.aggregatedContent?.toModel<MessageContent>()?.body
?: event.root.getClearContent().toModel<MessageContent>()?.body
?: stringProvider.getString(R.string.notification_unknown_new_event) ?: stringProvider.getString(R.string.notification_unknown_new_event)
val roomName = room.roomSummary?.displayName ?: "" val roomName = room.roomSummary?.displayName ?: ""
val senderDisplayName = event.senderName ?: "" val senderDisplayName = event.senderName ?: ""