diff libpurple/protocols/jabber/usernick.c @ 29896:93e8e6331d44

jabber: Allow jabber_pep_request_item() to take NULL for JID; server's routing takes care of the rest
author Paul Aurich <paul@darkrain42.org>
date Sat, 27 Feb 2010 04:02:50 +0000
parents c585572e80dd
children a8cc50c2279f
line wrap: on
line diff
--- 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) {