GroupChat sometimes displayed as normal Chat
Sometimes Groupchats are displayed as standard single user chats. The group is also added as a separate single user contact to the contact list.
This appears to happen because the connection PacketListener (in XmppConnection.java) in processPacket calls a findOrCreateSession method. As the whole session creation procedure is async the corresponding group session does not yet exist and is instead created (always as a single user session)!
Somehow the information that this session does not need to be created (as it is currently being created) needs to be passed to the
Thus the session creation thread would need to either:
Create some sort of semaphore or similar to indicate to the PacketListener, that there are session being created. (Meaning this packet would be delayed until later?)
What does surprise me is that there is a convertToGroupChat method - but I could not find any references to it being called at any time. (Except one commented out version in NewChatActivity.java)