comparison libpurple/protocols/gg/gg.c @ 31431:bcaa76a01b42

Gadu-Gadu: Support receiving typing indications. Fixes #13362. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author quantifier666@gmail.com
date Fri, 25 Mar 2011 11:45:06 +0000
parents dc63d77fea03
children 7db33b356d4a
comparison
equal deleted inserted replaced
31430:df4f9ffb699f 31431:bcaa76a01b42
1601 } 1601 }
1602 g_hash_table_remove(info->pending_images, GINT_TO_POINTER(ev->event.image_request.crc32)); 1602 g_hash_table_remove(info->pending_images, GINT_TO_POINTER(ev->event.image_request.crc32));
1603 } 1603 }
1604 } 1604 }
1605 1605
1606 static void ggp_typing_notification_handler(PurpleConnection *gc, uin_t uin, int length) {
1607 gchar *from;
1608
1609 from = g_strdup_printf("%u", uin);
1610 if (length)
1611 serv_got_typing(gc, from, 0, PURPLE_TYPING);
1612 else
1613 serv_got_typing(gc, from, 0, PURPLE_NOT_TYPING);
1614 g_free(from);
1615 }
1616
1606 static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) 1617 static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond)
1607 { 1618 {
1608 PurpleConnection *gc = _gc; 1619 PurpleConnection *gc = _gc;
1609 GGPInfo *info = gc->proto_data; 1620 GGPInfo *info = gc->proto_data;
1610 struct gg_event *ev; 1621 struct gg_event *ev;
1714 } 1725 }
1715 break; 1726 break;
1716 case GG_EVENT_PUBDIR50_SEARCH_REPLY: 1727 case GG_EVENT_PUBDIR50_SEARCH_REPLY:
1717 ggp_pubdir_reply_handler(gc, ev->event.pubdir50); 1728 ggp_pubdir_reply_handler(gc, ev->event.pubdir50);
1718 break; 1729 break;
1730 case GG_EVENT_TYPING_NOTIFICATION:
1731 ggp_typing_notification_handler(gc, ev->event.typing_notification.uin,
1732 ev->event.typing_notification.length);
1733 break;
1719 default: 1734 default:
1720 purple_debug_error("gg", 1735 purple_debug_error("gg",
1721 "unsupported event type=%d\n", ev->type); 1736 "unsupported event type=%d\n", ev->type);
1722 break; 1737 break;
1723 } 1738 }
2019 2034
2020 presence = purple_account_get_presence(account); 2035 presence = purple_account_get_presence(account);
2021 status = purple_presence_get_active_status(presence); 2036 status = purple_presence_get_active_status(presence);
2022 2037
2023 glp->encoding = GG_ENCODING_UTF8; 2038 glp->encoding = GG_ENCODING_UTF8;
2024 glp->protocol_features = (GG_FEATURE_STATUS80|GG_FEATURE_DND_FFC); 2039 glp->protocol_features = (GG_FEATURE_STATUS80|GG_FEATURE_DND_FFC
2040 |GG_FEATURE_TYPING_NOTIFICATION);
2025 2041
2026 glp->async = 1; 2042 glp->async = 1;
2027 glp->status = ggp_to_gg_status(status, &glp->status_descr); 2043 glp->status = ggp_to_gg_status(status, &glp->status_descr);
2028 glp->tls = 0; 2044 glp->tls = 0;
2029 2045