GNOME Bugzilla – Bug 633481
AccountChooser filters should be asynchronous
Last modified: 2010-11-15 09:12:20 UTC
Steps to reproduce: 1. Launch empathy. 2. Select 'Room->Join'. 3. Wait until all accounts are connected. Expected result: All accounts which support multiuser text conversations are enabled. Actual result: Only 'People nearby' is enabled. User has to close and reopen the dialog manually to make the remaining accounts enabled. Same issue is reproducible with 'Chat->New Conversation' and 'Chat->New Call'. Problem description: The issue is caused by empathy_account_chooser_filter_supports_multichat (src/empathy-new-chatroom-dialog.c): Despite of the fact that account connection is established and this condition is satisfied: if (tp_account_get_connection_status (account, NULL) != TP_CONNECTION_STATUS_CONNECTED) empathy_dispatcher_find_requestable_channel_classes returns null, because the object representing connection is not ready yet. This call should be replaced with the async version.
Fixed in repo: git://vminko.org/empathy branch: fix-633481
Created attachment 173496 [details] [review] proposed fix
Review of attachment 173496 [details] [review]: Thanks for the patch. empathy_dispatcher_find_requestable_channel_classes_async() has been removed in master (bug #632550). You should prepareTP_CONNECTION_FEATURE_CAPABILITIES and then use tp_connection_get_capabilities().
Fixed in fix-633481-v2
Created attachment 174231 [details] [review] new diff
Review of attachment 174231 [details] [review]: Thanks! The general logic seems good to me. Just some tweaks here and there to make things simpler/clearer. ::: libempathy-gtk/empathy-account-chooser.c @@ +767,2 @@ g_object_unref (account); + g_free (iter); gtk_tree_iter_free() @@ +793,3 @@ + return; + + data = g_slice_new0 (FilterResultCallbackData); For such struct, I usually like to have a _new() and _free() function; that makes things clearer. @@ +795,3 @@ + data = g_slice_new0 (FilterResultCallbackData); + data->chooser = chooser; + data->account = account; It's generally a good idea to ref objects stored in data structs. @@ +796,3 @@ + data->account = account; + data->iter = g_memdup (iter, sizeof (GtkTreeIter)); + g_free (iter); Use gtk_tree_iter_copy() ::: libempathy-gtk/empathy-new-message-dialog.c @@ +98,3 @@ + + caps = tp_connection_get_capabilities (TP_CONNECTION (conn)); + classes = tp_capabilities_get_channel_classes (caps); You can just use tp_capabilities_supports_text_chats() ::: src/empathy-new-chatroom-dialog.c @@ +154,3 @@ + + caps = tp_connection_get_capabilities (TP_CONNECTION (conn)); + classes = tp_capabilities_get_channel_classes (caps); You can just use tp_capabilities_supports_text_chatrooms()
Fixed in the same branch.
Great; merged. Thanks ! This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.