cpw.darkrain42.obsolete: e76f1154: Use Entity Capabilities to pick up Chat ...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Sun Jul 12 01:58:28 EDT 2009
-----------------------------------------------------------------
Revision: e76f11543c2a4aa05bdf584f087cbe3439029661
Ancestor: 29e40b402901ac468a396f7cdf98f0b983f2c768
Author: darkrain42 at pidgin.im
Date: 2009-07-12T05:25:59
Branch: im.pidgin.cpw.darkrain42.obsolete
URL: http://d.pidgin.im/viewmtn/revision/info/e76f11543c2a4aa05bdf584f087cbe3439029661
Modified files:
libpurple/protocols/jabber/message.c
libpurple/protocols/jabber/presence.c
ChangeLog:
Use Entity Capabilities to pick up Chat States support. Refs #4650.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c ee7b37d408aa8b624eb49ea4ad9cb81937766432
+++ libpurple/protocols/jabber/message.c 5d1e8cfe2cd2d8c42a2057793700f26366f69368
@@ -87,6 +87,9 @@ static void handle_chat(JabberMessage *j
}
if(!jm->xhtml && !jm->body) {
+ if (jbr)
+ jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+
if(JM_STATE_COMPOSING == jm->chat_state) {
serv_got_typing(jm->js->gc, from, 0, PURPLE_TYPING);
} else if(JM_STATE_PAUSED == jm->chat_state) {
============================================================
--- libpurple/protocols/jabber/presence.c e07fee32ace5d102e4858d8e216b95c3ebcef46e
+++ libpurple/protocols/jabber/presence.c 82d0efc69cbc205381700004a8d12e47f96b868d
@@ -447,6 +447,9 @@ jabber_presence_set_capabilities(JabberC
jbr->caps.info = info;
jbr->caps.exts = exts;
+ if (info == NULL)
+ goto out;
+
if (!jbr->commands_fetched && jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) {
JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items");
xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items");
@@ -458,6 +461,12 @@ jabber_presence_set_capabilities(JabberC
jbr->commands_fetched = TRUE;
}
+ if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/chatstates"))
+ jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+ else
+ jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+
+out:
g_free(userdata->from);
g_free(userdata);
}
More information about the Commits
mailing list