From 10490e3aa629d86b4c425c05eaf861882de5c83e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Jul 2019 16:00:06 +0200 Subject: [PATCH] Close detail room screen when the room is left with another client (#256) --- CHANGES.md | 1 + .../features/home/room/detail/RoomDetailFragment.kt | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cc5689d4..50cbb3e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Other changes: Bugfix: - Edited message: link confusion when (edited) appears in body (#398) + - Close detail room screen when the room is left with another client (#256) Translations: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index b7491ae6..1ff2c67d 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -536,9 +536,14 @@ class RoomDetailFragment : private fun renderRoomSummary(state: RoomDetailViewState) { state.asyncRoomSummary()?.let { - roomToolbarTitleView.text = it.displayName - avatarRenderer.render(it, roomToolbarAvatarImageView) - roomToolbarSubtitleView.setTextOrHide(it.topic) + if (it.membership.isLeft()) { + Timber.w("The room has been left") + activity?.finish() + } else { + roomToolbarTitleView.text = it.displayName + avatarRenderer.render(it, roomToolbarAvatarImageView) + roomToolbarSubtitleView.setTextOrHide(it.topic) + } } }