[empathy] Toggle telling others you are typing to them



commit f728987ff14494033cde4afa432c58671bf2615c
Author: Patrick F. Allen <pallenpost gmail com>
Date:   Sat Feb 11 08:52:14 2012 -0500

    Toggle telling others you are typing to them
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668985

 data/org.gnome.Empathy.gschema.xml.in |    5 +++++
 libempathy-gtk/empathy-chat.c         |   16 +++++++++++++++-
 libempathy/empathy-gsettings.h        |    1 +
 3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.Empathy.gschema.xml.in b/data/org.gnome.Empathy.gschema.xml.in
index d107a9b..8e7d9fd 100644
--- a/data/org.gnome.Empathy.gschema.xml.in
+++ b/data/org.gnome.Empathy.gschema.xml.in
@@ -206,6 +206,11 @@ present them to the user immediately.</_description>
       <_summary>Enable WebKit Developer Tools</_summary>
       <_description>Whether WebKit developer tools, such as the Web Inspector, should be enabled.</_description>
     </key>
+    <key name="send-chat-states" type="b">
+      <default>true</default>
+      <_summary>Inform other users when you are typing to them</_summary>
+      <_description>Whether to send the 'composing' or 'paused' chat states. Does not currently affect the 'gone' state.</_description>
+    </key>
     <key name="theme-chat-room" type="b">
       <default>true</default>
       <_summary>Use theme for chat rooms</_summary>
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 358b1b9..5b2cca9 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -377,11 +377,18 @@ static gboolean
 chat_composing_stop_timeout_cb (EmpathyChat *chat)
 {
 	EmpathyChatPriv *priv;
+	gboolean send_chat_states;
 
 	priv = GET_PRIV (chat);
 
 	priv->composing_stop_timeout_id = 0;
-	set_chat_state (chat, TP_CHANNEL_CHAT_STATE_PAUSED);
+	send_chat_states = g_settings_get_boolean (priv->gsettings_chat,
+	                                 EMPATHY_PREFS_CHAT_SEND_CHAT_STATES);
+	if (!send_chat_states) {
+		set_chat_state (chat, TP_CHANNEL_CHAT_STATE_ACTIVE);
+	} else {
+		set_chat_state (chat, TP_CHANNEL_CHAT_STATE_PAUSED);
+	}
 
 	return FALSE;
 }
@@ -390,9 +397,16 @@ static void
 chat_composing_start (EmpathyChat *chat)
 {
 	EmpathyChatPriv *priv;
+	gboolean send_chat_states;
 
 	priv = GET_PRIV (chat);
 
+	send_chat_states = g_settings_get_boolean (priv->gsettings_chat,
+	                                  EMPATHY_PREFS_CHAT_SEND_CHAT_STATES);
+	if (!send_chat_states) {
+		return;
+	}
+
 	if (priv->composing_stop_timeout_id) {
 		/* Just restart the timeout */
 		chat_composing_remove_timeout (chat);
diff --git a/libempathy/empathy-gsettings.h b/libempathy/empathy-gsettings.h
index 6206a54..fd05141 100644
--- a/libempathy/empathy-gsettings.h
+++ b/libempathy/empathy-gsettings.h
@@ -66,6 +66,7 @@ G_BEGIN_DECLS
 #define EMPATHY_PREFS_CHAT_AVATAR_IN_ICON          "avatar-in-icon"
 #define EMPATHY_PREFS_CHAT_WEBKIT_DEVELOPER_TOOLS  "enable-webkit-developer-tools"
 #define EMPATHY_PREFS_CHAT_ROOM_LAST_ACCOUNT       "room-last-account"
+#define EMPATHY_PREFS_CHAT_SEND_CHAT_STATES        "send-chat-states"
 
 #define EMPATHY_PREFS_UI_SCHEMA EMPATHY_PREFS_SCHEMA ".ui"
 #define EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS     "separate-chat-windows"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]