soc.2009.transport: a73f1b41: Added support for nicks in subscribe pre...

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Mon Jun 8 04:15:22 EDT 2009


-----------------------------------------------------------------
Revision: a73f1b413f8bc5d4811102a6ad0822b688a8884c
Ancestor: a9a27a06a1696a48a14b7d630279a92ad0f95e0d
Author: hanzz at soc.pidgin.im
Date: 2009-06-08T08:13:21
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/a73f1b413f8bc5d4811102a6ad0822b688a8884c

Modified files:
        user.cpp

ChangeLog: 

Added support for nicks in subscribe presences (XEP-0172)

-------------- next part --------------
============================================================
--- user.cpp	e0c887ef00ca7174d9341e5a6ede410883b53f15
+++ user.cpp	4e2fd35380c4829ff740d3d7bd45a71fd668076d
@@ -428,6 +428,9 @@ void User::purpleBuddyChanged(PurpleBudd
 				tag->addAttribute("type", "subscribe" );
 				tag->addAttribute("from", name + "@" + p->jid());
 				tag->addAttribute("to", m_jid);
+				Tag *nick = new Tag("nick", alias);
+				nick->addAttribute("xmlns","http://jabber.org/protocol/nick");
+				tag->addChild(nick);
 				p->j->send(tag);
 			}
 		}
@@ -617,6 +620,13 @@ void User::purpleAuthorizeReceived(Purpl
 	tag->addAttribute("type", "subscribe" );
 	tag->addAttribute("from", (std::string)remote_user + "@" + p->jid());
 	tag->addAttribute("to", m_jid);
+
+	if (alias) {
+		Tag *nick = new Tag("nick", (std::string) alias);
+		nick->addAttribute("xmlns","http://jabber.org/protocol/nick");
+		tag->addChild(nick);
+	}
+
 	std::cout << tag->xml() << "\n";
 	p->j->send(tag);
 


More information about the Commits mailing list