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 668985 - [PATCH] Toggle telling others you are typing to them
[PATCH] Toggle telling others you are typing to them
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Preferences
2.34.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-30 02:50 UTC by pallenpost
Modified: 2012-02-13 08:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to toggle telling others you are typing to them (6.33 KB, patch)
2012-01-30 02:50 UTC, pallenpost
reviewed Details | Review
rev 2 -- Patch to toggle telling others you are typing to them (2.26 KB, patch)
2012-02-04 13:28 UTC, pallenpost
none Details | Review
rev 3 -- Patch to toggle telling others you are typing to them (3.07 KB, patch)
2012-02-04 15:02 UTC, pallenpost
reviewed Details | Review
rev 4 -- Patch to toggle telling others you are typing to them (3.26 KB, patch)
2012-02-11 13:59 UTC, pallenpost
committed Details | Review

Description pallenpost 2012-01-30 02:50:42 UTC
Created attachment 206390 [details] [review]
Patch to toggle telling others you are typing to them

When you start or stop typing a message to someone in Empathy, normally Empathy's chat state changes to "composing" or "paused" respectively. When Empathy's state changes, this will probably display a message on the other user's IM client, saying "User X has started/stopped typing." This patch allows you to toggle whether or not to change state based on your typing, so Empathy doesn't tell others when you are typing to them.

Patch details:

Adds a checkbox in Preferences -> Behavior -> "Tell others when I am typing to them". This setting is referred to as "telltyping" internally.

When unchecked, functionality is the same as it is now without the patch.

When checked:

- If you start composing a message, the chat_composing_start() function returns before changing the state to composing or refreshing the composing timeout. Same thing in chat_composing_stop(), though I don't think it's necessary there (can anyone confirm?).

- If the composing timeout is hit and chat_composing_stop_timeout_cb() is called, the chat state is set to active (rather than paused). This is done instead of returning as in the other functions so that if the telltyping option is toggled while the state is composing, the state doesn't get stuck on composing until a message is sent. Instead, it will time out normally and go to active.

Tested with two local Empathy accounts, version 2.34.0.
Comment 1 Guillaume Desmottes 2012-01-30 09:27:49 UTC
Review of attachment 206390 [details] [review]:

Thanks for the patch. Out of curiosity why do you want to disable such notifications?

I really don't think we should add an option in the preferences dialog. Most users won't understand or even care about it. If anything, we could consider adding a gsetting key and maybe have the UI in gnome-tweak-tools. But even so, I'm not convinced it's worth adding such setting. I think that if we have it, it should disable all the chat states, not only typing/paused. But for XMPP for example, the 'gone' state is send directly by Gabble (the XMPP backend) so that's not something Empathy can control.
See http://telepathy.freedesktop.org/spec/Channel_Interface_Chat_State.html about the different chat states.

::: empathy_orig/empathy-2.34.0/src/empathy-preferences.ui
@@ +314,3 @@
 	priv->composing_stop_timeout_id = 0;
+
+	telltyping = g_settings_get_boolean (priv->gsettings_chat, EMPATHY_PREFS_CHAT_TELLTYPING);

Does this callback will ever be called? The timeout will never be enabled in chat_composing_start().

@@ +335,3 @@
 
+	telltyping = g_settings_get_boolean (priv->gsettings_chat, EMPATHY_PREFS_CHAT_TELLTYPING);
+	if (! telltyping) {

our coding style is : "if (!badger) {"

@@ +51,3 @@
 adium-path = /apps/empathy/conversation/adium_path
 enable-webkit-developer-tools = /apps/empathy/conversation/enable_webkit_developer_tools
+telltyping = /apps/empathy/conversation/telltyping

No need to add a convert key, this is for old gconf key being migrated to dconf.

@@ +195,3 @@
       <_description>Whether WebKit developer tools, such as the Web Inspector, should be enabled.</_description>
     </key>
+    <key type="b" name="telltyping">

I don't like this name. It could be something like send-chat-states but as I said above that wouldn't cover 'gone'.
Comment 2 pallenpost 2012-01-31 00:23:23 UTC
> why do you want to disable such notifications?

The use case for this is for people who don't like to let others see their thoughts percolating (or even let the other know a message has been read) as they draft a reply.

Some people don't seem to like it when others can tell that they start/stop typing. If you begin a reply to someone, the other person sees that you're present and in the process of replying, and begins waiting on your response. Occassionally one may start typing, then want to stop and think before sending the reply or possibly not send a reply at all. Some people don't like to let others see them mulling in this way.

This is not a core feature so it's probably right to say that most users won't care about it, but I know I'm not the first person to think of it. For both empathy and pidgin, a web search of "disable typing notification <client>" or similar will return hits asking how to do this. I see >200 views on an askubuntu stack exchange question from 2010 regarding doing this in empathy, and >400 for pidgin in the same time frame. That's a distinct minority who are willing to look for it, but it shows that there are people that want to do it in empathy, and there are people that are accustomed to having the feature from using pidgin or other clients (who would presumably want the same feature if they were to switch to empathy).

> I think that if we have it,
> it should disable all the chat states, not only typing/paused. But for XMPP for
> example, the 'gone' state is send directly by Gabble (the XMPP backend) so
> that's not something Empathy can control.

I hadn't thought about "gone" -- that would be nice to control, too. I had been mainly thinking of XMPP while writing this as that's all I use, so it's a shame that it wouldn't work for that. May poke around and see what would be involved in that for non-XMPP protocols.

> Does this callback will ever be called? The timeout will never be enabled in
> chat_composing_start().

There is one case that the callback will get called when this is disabled: if you start typing, then disable the setting before the timeout hits. In that case, you would return to the paused state until you send the message you're currently typing. Not very likely given a 5 second timeout, but it's possible. It would be ideal to handle this only when the setting is changed, but it didn't seem like there would be easy access to the chat channels from wherever that code was being called (thoughts?). Yesterday was the first I'd looked at the code and I didn't dig in to pursue it because it didn't seem likely to be possible.

> I don't like this name. It could be something like send-chat-states but as I
> said above that wouldn't cover 'gone'.

send-composing-state? send-composing-paused-state?
Comment 3 Jonny Lamb 2012-01-31 00:43:37 UTC
I think that using any name other than something including "chat states" for this would be ridiculous. I personally vote for Guillaume's suggestion and ignore 'gone'.
Comment 4 Guillaume Desmottes 2012-01-31 09:56:37 UTC
Ok, let's go for "send-chat-states" and say in the description that some connection managers may still send the 'gone' state even if this setting is disabled.

Can you please cook a new patch removing all the UI bits? If you feel keen you can even cook a gnome-tweak-tool patch as well adding an Empathy page and having UI to set this setting. If not no worry, I'll do it myself at some point.
Comment 5 pallenpost 2012-02-04 13:28:30 UTC
Created attachment 206757 [details] [review]
rev 2 -- Patch to toggle telling others you are typing to them

Attached a patch without the UI settings, and addressing the other comments. Taking a look at gnome-tweak-tool.
Comment 6 pallenpost 2012-02-04 15:02:53 UTC
Created attachment 206762 [details] [review]
rev 3 -- Patch to toggle telling others you are typing to them

Left out the xml schema in the previous patch.
Comment 7 Guillaume Desmottes 2012-02-06 10:00:35 UTC
Review of attachment 206762 [details] [review]:

Thanks for the patch. Unfortunatelly it doesn't apply on top of master. Could you please record a proper git commit on top of master and attach it using git format-patch?
Comment 8 pallenpost 2012-02-11 13:59:38 UTC
Created attachment 207339 [details] [review]
rev 4 -- Patch to toggle telling others you are typing to them

Attached patch against master.
Comment 9 Guillaume Desmottes 2012-02-13 08:32:14 UTC
Review of attachment 207339 [details] [review]:

Thanks for the patch. I fixed it and pushed it to master.

::: libempathy-gtk/empathy-chat.c
@@ +386,3 @@
+	                                 EMPATHY_PREFS_CHAT_SEND_CHAT_STATES);
+	if (!send_chat_states) {
+		empathy_tp_chat_set_state (priv->tp_chat,

Should be set_chat_state().