Mercurial > pidgin
changeset 21690:33285f8f68ba
merge of '125f56f31252d721a347d2d2e379956433c1d8b5'
and 'c1a40e1accb59a7d8fa230b529bf457014ed99af'
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 29 Nov 2007 23:21:14 +0000 (2007-11-29) |
parents | 882ac6616de9 (diff) 3f87c3265740 (current diff) |
children | 3ed9b027479d |
files | |
diffstat | 2 files changed, 25 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/caps.c Thu Nov 29 19:04:44 2007 +0000 +++ b/libpurple/protocols/jabber/caps.c Thu Nov 29 23:21:14 2007 +0000 @@ -257,18 +257,23 @@ /* this function assumes that all information is available locally */ static JabberCapsClientInfo *jabber_caps_collect_info(const char *node, const char *ver, GList *ext) { - JabberCapsClientInfo *result = g_new0(JabberCapsClientInfo, 1); + JabberCapsClientInfo *result; JabberCapsKey *key = g_new0(JabberCapsKey, 1); JabberCapsValue *caps; GList *iter; - + key->node = (char *)node; key->ver = (char *)ver; - + caps = g_hash_table_lookup(capstable,key); - + g_free(key); - + + if (caps == NULL) + return NULL; + + result = g_new0(JabberCapsClientInfo, 1); + /* join all information */ for(iter = caps->identities; iter; iter = g_list_next(iter)) { JabberCapsIdentity *id = iter->data;
--- a/libpurple/protocols/jabber/presence.c Thu Nov 29 19:04:44 2007 +0000 +++ b/libpurple/protocols/jabber/presence.c Thu Nov 29 23:21:14 2007 +0000 @@ -376,23 +376,26 @@ static void jabber_presence_set_capabilities(JabberCapsClientInfo *info, gpointer user_data) { JabberPresenceCapabilities *userdata = user_data; GList *iter; - + if(userdata->jbr->caps) jabber_caps_free_clientinfo(userdata->jbr->caps); userdata->jbr->caps = info; - - for(iter = info->features; iter; iter = g_list_next(iter)) { - if(!strcmp((const char*)iter->data, "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"); - xmlnode_set_attrib(iq->node, "to", userdata->from); - xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands"); - - jabber_iq_set_callback(iq, jabber_adhoc_disco_result_cb, NULL); - jabber_iq_send(iq); - break; + + if (info) { + for(iter = info->features; iter; iter = g_list_next(iter)) { + if(!strcmp((const char*)iter->data, "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"); + xmlnode_set_attrib(iq->node, "to", userdata->from); + xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands"); + + jabber_iq_set_callback(iq, jabber_adhoc_disco_result_cb, NULL); + jabber_iq_send(iq); + break; + } } } + g_free(userdata->from); g_free(userdata); }