# HG changeset patch # User quantifier666@gmail.com # Date 1301053506 0 # Node ID bcaa76a01b426ed7a16527bec3e3ead230288415 # Parent df4f9ffb699f22aa4dfd28184e7c15475a05d052 Gadu-Gadu: Support receiving typing indications. Fixes #13362. committer: John Bailey diff -r df4f9ffb699f -r bcaa76a01b42 libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Fri Mar 25 04:56:36 2011 +0000 +++ b/libpurple/protocols/gg/gg.c Fri Mar 25 11:45:06 2011 +0000 @@ -1603,6 +1603,17 @@ } } +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 @@ 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 @@ 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);