pidgin: d759af21: Gadu-Gadu: Support receiving typing ind...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Fri Mar 25 07:58:50 EDT 2011


----------------------------------------------------------------------
Revision: d759af21d3baeffeb37c51edd5b5a32b4fb45906
Parent:   40ac21cffeec1a6ccb95ee0290e1f4f457fd8ff4
Author:   quantifier666 at gmail.com
Date:     03/25/11 07:45:06
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d759af21d3baeffeb37c51edd5b5a32b4fb45906

Changelog: 

Gadu-Gadu:  Support receiving typing indications.  Fixes #13362.

Changes against parent 40ac21cffeec1a6ccb95ee0290e1f4f457fd8ff4

  patched  libpurple/protocols/gg/gg.c

-------------- next part --------------
============================================================
--- libpurple/protocols/gg/gg.c	b05c81008b4ae32f5a6d77b49f436a29c69353d6
+++ libpurple/protocols/gg/gg.c	4ce3b37979be3737113ee163382036f938e79b8a
@@ -1603,6 +1603,17 @@ static void ggp_send_image_handler(Purpl
 	}
 }
 
+static void ggp_typing_notification_handler(PurpleConnection *gc, uin_t uin, int length) {
+    gchar *from;
+
+    from = g_strdup_printf("%u", uin);
+    if (length)
+	serv_got_typing(gc, from, 0, PURPLE_TYPING);
+    else
+	serv_got_typing(gc, from, 0, PURPLE_NOT_TYPING);
+    g_free(from);
+}
+
 static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond)
 {
 	PurpleConnection *gc = _gc;
@@ -1716,6 +1727,10 @@ static void ggp_callback_recv(gpointer _
 		case GG_EVENT_PUBDIR50_SEARCH_REPLY:
 			ggp_pubdir_reply_handler(gc, ev->event.pubdir50);
 			break;
+		case GG_EVENT_TYPING_NOTIFICATION:
+			ggp_typing_notification_handler(gc, ev->event.typing_notification.uin,
+				ev->event.typing_notification.length);
+			break;
 		default:
 			purple_debug_error("gg",
 				"unsupported event type=%d\n", ev->type);
@@ -2021,7 +2036,8 @@ static void ggp_login(PurpleAccount *acc
 	status = purple_presence_get_active_status(presence);
 
 	glp->encoding = GG_ENCODING_UTF8;
-	glp->protocol_features = (GG_FEATURE_STATUS80|GG_FEATURE_DND_FFC);
+	glp->protocol_features = (GG_FEATURE_STATUS80|GG_FEATURE_DND_FFC
+		|GG_FEATURE_TYPING_NOTIFICATION);
 
 	glp->async = 1;
 	glp->status = ggp_to_gg_status(status, &glp->status_descr);


More information about the Commits mailing list