pidgin: 8e3ce42b: Handle User Nick notifications via <pres...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat May 2 00:15:32 EDT 2009


-----------------------------------------------------------------
Revision: 8e3ce42b3d6264d5e582fc55da07f8ec8d4afe0c
Ancestor: 482582ebb56dfa52fc8ddff33fbe7fd778701072
Author: darkrain42 at pidgin.im
Date: 2009-05-02T04:14:09
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8e3ce42b3d6264d5e582fc55da07f8ec8d4afe0c

Modified files:
        libpurple/protocols/jabber/presence.c
        libpurple/protocols/jabber/usernick.c

ChangeLog: 

Handle User Nick notifications via <presence/> stanzas (receive-only). Refs #864.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/presence.c	3ca36c3b6cd75ab4f5426ffcb5078dc92596eb78
+++ libpurple/protocols/jabber/presence.c	93058e206a0cfa52e4329fe4fe3be06cf91a7ff9
@@ -441,6 +441,7 @@ void jabber_presence_parse(JabberStream 
 	char *avatar_hash = NULL;
 	xmlnode *caps = NULL;
 	int idle = 0;
+	const gchar *nick = NULL;
 
 	if(!(jb = jabber_buddy_find(js, from, TRUE)))
 		return;
@@ -526,6 +527,8 @@ void jabber_presence_parse(JabberStream 
 			stamp = xmlnode_get_attrib(y, "stamp");
 		} else if(!strcmp(y->name, "c") && !strcmp(xmlns, "http://jabber.org/protocol/caps")) {
 			caps = y; /* store for later, when creating buddy resource */
+		} else if (g_str_equal(y->name, "nick") && g_str_equal(xmlns, "http://jabber.org/protocol/nick")) {
+			nick = xmlnode_get_data(y);
 		} else if(!strcmp(y->name, "x")) {
 			if(!strcmp(xmlns, "jabber:x:delay")) {
 				/* XXX: compare the time.  jabber:x:delay can happen on presence packets that aren't really and truly delayed */
@@ -784,6 +787,8 @@ void jabber_presence_parse(JabberStream 
 			jabber_google_presence_incoming(js, buddy_name, found_jbr);
 			purple_prpl_got_user_status(js->gc->account, buddy_name, jabber_buddy_state_get_status_id(found_jbr->state), "priority", found_jbr->priority, "message", found_jbr->status, NULL);
 			purple_prpl_got_user_idle(js->gc->account, buddy_name, found_jbr->idle, found_jbr->idle);
+			if (nick)
+				serv_got_alias(js->gc, buddy_name, nick);
 		} else {
 			purple_prpl_got_user_status(js->gc->account, buddy_name, "offline", status ? "message" : NULL, status, NULL);
 		}
============================================================
--- libpurple/protocols/jabber/usernick.c	5967c50fbd036b724386798c46fbc1af8cb833bb
+++ libpurple/protocols/jabber/usernick.c	8899d3bf4a0abc325ec9273b06f25a5722258104
@@ -35,7 +35,7 @@ static void jabber_nick_cb(JabberStream 
 	xmlnode *nick;
 	char *nickname = NULL;
 
-	/* ignore the tune of people not on our buddy list */
+	/* ignore the nick of people not on our buddy list */
 	if (!buddy || !item)
 		return;
 


More information about the Commits mailing list