# HG changeset patch # User Paul Aurich # Date 1267243370 0 # Node ID 93e8e6331d44a7aa0eb587d0e2539dd9245d9da3 # Parent 0d3151a41134d3c38f7fc8dd3695bfbff1a54ce3 jabber: Allow jabber_pep_request_item() to take NULL for JID; server's routing takes care of the rest diff -r 0d3151a41134 -r 93e8e6331d44 libpurple/protocols/jabber/pep.c --- a/libpurple/protocols/jabber/pep.c Sat Feb 27 03:49:32 2010 +0000 +++ b/libpurple/protocols/jabber/pep.c Sat Feb 27 04:02:50 2010 +0000 @@ -89,10 +89,11 @@ JabberIq *iq = jabber_iq_new(js, JABBER_IQ_GET); xmlnode *pubsub, *items; - xmlnode_set_attrib(iq->node,"to",to); + if (to) + xmlnode_set_attrib(iq->node, "to", to); + pubsub = xmlnode_new_child(iq->node,"pubsub"); - - xmlnode_set_namespace(pubsub,"http://jabber.org/protocol/pubsub"); + xmlnode_set_namespace(pubsub, "http://jabber.org/protocol/pubsub"); items = xmlnode_new_child(pubsub, "items"); xmlnode_set_attrib(items,"node",node); diff -r 0d3151a41134 -r 93e8e6331d44 libpurple/protocols/jabber/useravatar.c --- a/libpurple/protocols/jabber/useravatar.c Sat Feb 27 03:49:32 2010 +0000 +++ b/libpurple/protocols/jabber/useravatar.c Sat Feb 27 04:02:50 2010 +0000 @@ -239,16 +239,12 @@ void jabber_avatar_fetch_mine(JabberStream *js) { - char *jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); - if (js->initial_avatar_hash) { - jabber_pep_request_item(js, jid, NS_AVATAR_0_12_METADATA, NULL, + jabber_pep_request_item(js, NULL, NS_AVATAR_0_12_METADATA, NULL, do_got_own_avatar_0_12_cb); - jabber_pep_request_item(js, jid, NS_AVATAR_1_1_METADATA, NULL, + jabber_pep_request_item(js, NULL, NS_AVATAR_1_1_METADATA, NULL, do_got_own_avatar_cb); } - - g_free(jid); } typedef struct _JabberBuddyAvatarUpdateURLInfo { diff -r 0d3151a41134 -r 93e8e6331d44 libpurple/protocols/jabber/usernick.c --- a/libpurple/protocols/jabber/usernick.c Sat Feb 27 03:49:32 2010 +0000 +++ b/libpurple/protocols/jabber/usernick.c Sat Feb 27 04:02:50 2010 +0000 @@ -86,14 +86,12 @@ } static void do_nick_set_nick(PurplePluginAction *action) { - PurpleConnection *gc = (PurpleConnection *) action->context; - JabberStream *js = gc->proto_data; - char *jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); + PurpleConnection *gc = action->context; + JabberStream *js = purple_connection_get_protocol_data(gc); /* since the nickname might have been changed by another resource of this account, we always have to request the old one from the server to present as the default for the new one */ - jabber_pep_request_item(js, jid, "http://jabber.org/protocol/nick", NULL, do_nick_got_own_nick_cb); - g_free(jid); + jabber_pep_request_item(js, NULL, "http://jabber.org/protocol/nick", NULL, do_nick_got_own_nick_cb); } void jabber_nick_init(void) {