Fix ban and kick bad message error (Fixes #184 Fixes #248)

This commit is contained in:
Benoit Marty 2019-07-01 11:27:57 +02:00
parent 466a39d239
commit 2eef0a6162

View File

@ -152,7 +152,7 @@ class NoticeEventFormatter @Inject constructor(private val stringProvider: Strin


private fun buildMembershipNotice(event: Event, senderName: String?, eventContent: RoomMember?, prevEventContent: RoomMember?): String? { private fun buildMembershipNotice(event: Event, senderName: String?, eventContent: RoomMember?, prevEventContent: RoomMember?): String? {
val senderDisplayName = senderName ?: event.senderId val senderDisplayName = senderName ?: event.senderId
val targetDisplayName = eventContent?.displayName ?: event.senderId val targetDisplayName = eventContent?.displayName ?: prevEventContent?.displayName ?: ""
return when { return when {
Membership.INVITE == eventContent?.membership -> { Membership.INVITE == eventContent?.membership -> {
// TODO get userId // TODO get userId