A Kick appears has "someone has made no change" (Fixes #1959)

This commit is contained in:
Benoit Marty 2020-08-19 15:54:46 +02:00
parent 482a8f1fb8
commit 9b6c45e112
2 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Bugfix 🐛:
- Fix crash reported by RageShake - Fix crash reported by RageShake
- Fix refreshing of sessions list when another session is logged out - Fix refreshing of sessions list when another session is logged out
- Failed to build unique file (#1954) - Failed to build unique file (#1954)
- A Kick appears has "someone has made no change" (#1959)
Translations 🗣: Translations 🗣:
- Add PlayStore description resources in the Triple-T format, to let Weblate handle them - Add PlayStore description resources in the Triple-T format, to let Weblate handle them

View File

@ -327,6 +327,7 @@ class NoticeEventFormatter @Inject constructor(private val activeSessionDataSour
val eventContent: RoomMemberContent? = event.getClearContent().toModel() val eventContent: RoomMemberContent? = event.getClearContent().toModel()
val prevEventContent: RoomMemberContent? = event.resolvedPrevContent().toModel() val prevEventContent: RoomMemberContent? = event.resolvedPrevContent().toModel()
val isMembershipEvent = prevEventContent?.membership != eventContent?.membership val isMembershipEvent = prevEventContent?.membership != eventContent?.membership
|| eventContent?.membership == Membership.LEAVE
return if (isMembershipEvent) { return if (isMembershipEvent) {
buildMembershipNotice(event, senderName, eventContent, prevEventContent) buildMembershipNotice(event, senderName, eventContent, prevEventContent)
} else { } else {
@ -569,6 +570,7 @@ class NoticeEventFormatter @Inject constructor(private val activeSessionDataSour
sp.getString(R.string.notice_room_withdraw_with_reason, senderDisplayName, targetDisplayName, reason) sp.getString(R.string.notice_room_withdraw_with_reason, senderDisplayName, targetDisplayName, reason)
} ?: sp.getString(R.string.notice_room_withdraw, senderDisplayName, targetDisplayName) } ?: sp.getString(R.string.notice_room_withdraw, senderDisplayName, targetDisplayName)
} }
Membership.LEAVE,
Membership.JOIN -> Membership.JOIN ->
if (event.isSentByCurrentUser()) { if (event.isSentByCurrentUser()) {
eventContent.safeReason?.let { reason -> eventContent.safeReason?.let { reason ->