1) Open an IM conversation with one or more contacts
2) Close the chat tab
3) In a message header that is showing presence for one of your chat contacts (that was not part of the conversations in part 1), click on the indicator to open up a conversation with that user.
The chat tab is opened and focused, but no conversation for the selected user appears. What's more, manually opening a conversation with the contact from part 3 is now impossible, and throws the following error:
The conversations should open properly with the selected contact.
I believe this is related to the code in openTab for the chat tab, which only appears to call _addConversation for the UI Conversations iff the element after conversationsGroup is searchResultConv.
Why do we only call _addConversation in the chat tab openTab function when conversationsGroup is next to searchResultConv?
(In reply to Mike Conley (:mconley) from comment #1)
> Why do we only call _addConversation in the chat tab openTab function when
> conversationsGroup is next to searchResultConv?
That code (lines 108-116) builds the displayed list of conversations the first time the chat tab is opened. "conversationsGroup is next to searchResultConv" is a way to test that the list of displayed conversations is currently empty.
After that, new conversations are added when the new-ui-conversation notification is received. The bug here is because when receiving new-ui-conversation we test gChatTab as a way to know if the chat tab is opened, but we should instead test if it has ever been opened, or something like that.
Created attachment 647997 [details] [diff] [review]
Something like this?
Comment on attachment 647997 [details] [diff] [review]
This patch is ok with me if it fixes the issue (I'm assuming again that you have verified it does ;)).