GNOME Bugzilla – Bug 684971
empathy-chat: loses multi personas in the the contact menu
Last modified: 2012-09-28 11:25:38 UTC
- Open a chat with an individual having at least 2 persona. Open the 'Contact' menu: all the personas are listed - Open a chat with another individual - Go back to the first individual and re-open the 'Contact' menu: the personas are now listed any more.
Here is what's happening: The first time the menu is created, individual_menu_add_personas(IndivididualA) is called and does: foreach (persona from individual): single_individual = empathy_create_individual_from_tp_contact (persona.tp_contact) This is used to create a new 'contact sub menu' per persona. By doing this persona.individual changes from IndividualA to single_individual. Then when we switch to another individual, the menu is destroyed and single_individual is destroyed (it was just a transient individual created for the sole purpose of the menu). As this individual is destroyed, Folks's weak ref reset persona.individual to NULL. So when we switch back to individualA again, the persona -> individual link is lost and so everything is confused.
Created attachment 225325 [details] [review] individual_menu_add_personas(): restore the persona.individual after creating single_individual
This patch is pretty hacky but does the job and fixes the bug. I'm open to better suggestion.
(In reply to comment #3) > This patch is pretty hacky but does the job and fixes the bug. I'm open to > better suggestion. This is no more hacky than the empathy_create_individual_from_tp_contact() call is. So it’s quite hacky. It’s probably the best solution short of getting rewriting the whole lot to get rid of empathy_create_individual_from_tp_contact().
Thanks, that will do as a fix fo 3.6 then. :)
Attachment 225325 [details] pushed as 3657e26 - individual_menu_add_personas(): restore the persona.individual after creating single_individual