Fix / use senderId when display name cannot be resolved

This commit is contained in:
Valere 2019-06-27 17:58:11 +02:00
parent 0765d6d1da
commit d5625b95fe
1 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ class NotifiableEventResolver(private val stringProvider: StringProvider,
?: event.root.getClearContent().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 = stringProvider.getString(R.string.notification_unknown_room_name) val roomName = stringProvider.getString(R.string.notification_unknown_room_name)
val senderDisplayName = event.senderName val senderDisplayName = event.senderName ?: event.root.senderId
val notifiableEvent = NotifiableMessageEvent( val notifiableEvent = NotifiableMessageEvent(
eventId = event.root.eventId!!, eventId = event.root.eventId!!,
@ -117,7 +117,7 @@ class NotifiableEventResolver(private val stringProvider: StringProvider,
?: event.root.getClearContent().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 ?: event.root.senderId
val notifiableEvent = NotifiableMessageEvent( val notifiableEvent = NotifiableMessageEvent(
eventId = event.root.eventId!!, eventId = event.root.eventId!!,