Group Chat: ActionBar changes to non-group chat layout when non group chat is also open
After initiating a group chat (by joining an existing MUC) the action bar looks as it should for group chats (no 'lock'-icon to indicate missing encryption)
If there is another chat with a contact open, this will change to the single user chat action bar after almost any action. Thus there will be a 'lock' menu item in the action bar, and the tabs at the second level will be coloured either yellow or red, indicating a 'wrong' encryption status.
I have attached a screenshot of the correct action bar after starting the chat, and three screenshots (one green, one yellow, one red) of the incorrect action bars.
The action bar appears to keep the status of the last chat viewed when changing from an active single user chat, or to revert to a red status after viewing the details of a chat member (by clicking on a message).
(Note: the chat member is displayed wrong as well, but that is part of another bug :-) )
The consequence of this bug is that the user can try to 'secure' the group chat (currently not possible), which will result in an endless spinning action bar, as well as the message shown in all of the screenshots. (Which ironically recommends installing chatsecure.)
This bug does not occur when the viewed group chat is the only active chat.
#1 Updated by phoenix_nz over 3 years ago
After some debugging I believe the error to be in ChatView.java - Method updateWarningView() - Line 1323.
The Method correctly checks if the current view is a group chat and then exits. But the attributes which cause the the ActionBar to look wrong are thus not reset properly.
The only view that is hidden if the user is in a group chat is mStatusWarningView.
In a single user chat, the method mActivity.updateEncryptionMenuState() is called. This method (implemented in NewChatActivity.java - Line 732) will set the colour of mChatPagerTitleStrip as well as showing the appropriate encryption icon.
There are several ways of fixing this problem:
1. We extend updateEncryptionMenuState to deal with group chats as a 'type' of state. Then this method will always need to be called in updateWarningView (not only for single user chats)
2. We create a new method in NewChatView.java hideEncryptionMenu which can be called if the chat is a group chat.
Personally I prefer Option 1 - the method name updateEncryptionMenuState is generic enough to account for a new State - 'group chat'.
#2 Updated by phoenix_nz over 3 years ago
Fix added with pull request 443 (https://github.com/guardianproject/ChatSecureAndroid/pull/443)