Commit 41c30a55 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Check if fragment already has a view and is still attached

parent 3297d999
...@@ -276,10 +276,12 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -276,10 +276,12 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
) { ) {
// TODO: We should rely solely on the user being able to post, but we cannot guarantee // TODO: We should rely solely on the user being able to post, but we cannot guarantee
// that the "(channels|groups).roles" endpoint is supported by the server in use. // that the "(channels|groups).roles" endpoint is supported by the server in use.
ui {
setupMessageComposer(userCanPost) setupMessageComposer(userCanPost)
isBroadcastChannel = channelIsBroadcast isBroadcastChannel = channelIsBroadcast
if (isBroadcastChannel && !userCanMod) activity?.invalidateOptionsMenu() if (isBroadcastChannel && !userCanMod) activity?.invalidateOptionsMenu()
} }
}
override fun openDirectMessage(chatRoom: ChatRoom, permalink: String) { override fun openDirectMessage(chatRoom: ChatRoom, permalink: String) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment