GNOME Bugzilla – Bug 609419
Display "typing" icon in muc contacts list
Last modified: 2011-01-18 15:12:55 UTC
The "typing" icon should appear in the muc contacts list instead of the tab so we know who is actually typing.
After discussion with Xavier, we agreed that an easy way to do that would be to modify contact_list_store_get_contact_status_icon() to return the 'typing' icon if the contact is currently typing. Checking if a contact is typing could be done using EmpathyTpChat. The EmpathyContactList stored EmpathyContactListStore can be a EmpathyTpChat (it implements the ContactList interface) so you'll have to check if the EmpathyContactList is actually a EmpathyTpChat before handling chat states. EmpathyTpChat doesn't have getter for the chat state, so you'll have to add one. That's easy, just wrap tp_channel_get_chat_state. You'll also have to connect the chat-state-changed signal in contact_list_store_iface_setup() if the list is actually an EmpathyTpChat. In the callback just call contact_list_store_contact_update() to update the model.
Created attachment 178473 [details] [review] Display typing icon in private chats' and chat-rooms' contacts lists
The above patch works for the latest telepathy-gabble built from its GIT repository which has the improper parsing in 'composing' chat states rectified. My branch for the same: http://gitorious.org/glassrose-gnome/empathy/commits/Display-typing-icon-in-muc-contacts-list-609419
Review of attachment 178473 [details] [review]: ::: libempathy-gtk/empathy-contact-list-store.c @@ +193,3 @@ + GList *contacts, *l; + + contacts = empathy_contact_list_get_members (priv->list); This function returns a list of reffed contact, you should unref them when you're done. @@ +253,3 @@ store); + if(EMPATHY_IS_TP_CHAT (priv->list)) { missing space: "if ()" @@ +258,3 @@ + tp_proxy_prepare_async ( + empathy_tp_chat_get_channel (EMPATHY_TP_CHAT (priv->list)), + features, channel_features_prepared_cb, user_data); You shouldn't have to prepare this manually. Ask tp-glib to do it for you. Look where we create EmpathyTpChat; you should be able to ask for this feature using tp_base_client_add_connection_features_varargs(). ::: libempathy/empathy-tp-chat.c @@ +1963,3 @@ +TpChannelChatState +empathy_tp_chat_get_chat_state (EmpathyTpChat *chat, + TpHandle contact) Either take an EmpathyContact as argument, or use directly tp_channel_get_chat_state() and remove this wrapper. ::: libempathy/empathy-tp-chat.h @@ +107,3 @@ TpHandle *inviter); +TpChannelChatState + empathy_tp_chat_get_chat_state (EmpathyTpChat *chat, should be on the same line as the return type
Created attachment 178570 [details] [review] Corrected patch I hope this patch looks good to you. I have made all changes in your review except: > ::: libempathy/empathy-tp-chat.h > @@ +107,3 @@ > TpHandle *inviter); > +TpChannelChatState > + empathy_tp_chat_get_chat_state (EmpathyTpChat *chat, > > should be on the same line as the return type since changing this will disrupt the alignment of the file. Other long statements in the surrounding code are also written in the same way to meet the alignment. I just took hints from contextual code. If you still want it changed, i'll change it.
Review of attachment 178570 [details] [review]: Looks pretty good. 2 small changes and we're done! ::: libempathy-gtk/empathy-contact-list-store.c @@ +199,3 @@ + if (empathy_contact_get_handle (EMPATHY_CONTACT (l->data)) == + contact_handle) { + break; You may not unref all the contacts as you break the loop. Best to use g_list_foreach (contacts, g_object_unref); at the end on the function when you're done. ::: src/empathy-chat-manager.c @@ +293,3 @@ tp_base_client_add_connection_features_varargs (priv->handler, TP_CONNECTION_FEATURE_CAPABILITIES, 0); + tp_base_client_add_channel_features_varargs (priv->handler, You can group these 2 calls together.
Created attachment 178612 [details] [review] Corrected patch Changes made and branch updated. :)
All good, merged to master; 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.