# HG changeset patch # User Paul Aurich # Date 1247376359 0 # Node ID ed284238509be24c108ae931a59aa44d42836c5f # Parent 5d82a9298ed5005d1c8cf39e0d5bf456937a1a3a Use Entity Capabilities to pick up Chat States support. Refs #4650. diff -r 5d82a9298ed5 -r ed284238509b libpurple/protocols/jabber/message.c --- a/libpurple/protocols/jabber/message.c Sun Jul 12 05:14:32 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Sun Jul 12 05:25:59 2009 +0000 @@ -87,6 +87,9 @@ } 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) { diff -r 5d82a9298ed5 -r ed284238509b libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Sun Jul 12 05:14:32 2009 +0000 +++ b/libpurple/protocols/jabber/presence.c Sun Jul 12 05:25:59 2009 +0000 @@ -447,6 +447,9 @@ 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 @@ 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); }