After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609419 - Display "typing" icon in muc contacts list
Display "typing" icon in muc contacts list
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Multi User Chat
2.29.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-09 13:27 UTC by Guillaume Desmottes
Modified: 2011-01-18 15:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Display typing icon in private chats' and chat-rooms' contacts lists (4.90 KB, patch)
2011-01-17 08:21 UTC, Chandni Verma
reviewed Details | Review
Corrected patch (5.28 KB, patch)
2011-01-17 22:20 UTC, Chandni Verma
reviewed Details | Review
Corrected patch (5.45 KB, patch)
2011-01-18 10:34 UTC, Chandni Verma
none Details | Review

Description Guillaume Desmottes 2010-02-09 13:27:22 UTC
The "typing" icon should appear in the muc contacts list instead of the tab so we know who is actually typing.
Comment 1 Guillaume Desmottes 2011-01-13 15:45:28 UTC
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.
Comment 2 Chandni Verma 2011-01-17 08:21:11 UTC
Created attachment 178473 [details] [review]
Display typing icon in private chats' and chat-rooms' contacts lists
Comment 3 Chandni Verma 2011-01-17 08:25:27 UTC
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
Comment 4 Guillaume Desmottes 2011-01-17 08:54:36 UTC
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
Comment 5 Chandni Verma 2011-01-17 22:20:12 UTC
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.
Comment 6 Guillaume Desmottes 2011-01-18 08:19:33 UTC
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.
Comment 7 Chandni Verma 2011-01-18 10:34:34 UTC
Created attachment 178612 [details] [review]
Corrected patch

Changes made and branch updated. :)
Comment 8 Guillaume Desmottes 2011-01-18 15:12:55 UTC
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.