pidgin: b6bd214d: Send circle authentication on the notifi...

qulogic at pidgin.im qulogic at pidgin.im
Fri Feb 3 01:56:31 EST 2012


----------------------------------------------------------------------
Revision: b6bd214d29db885c6d28628c163fa144bdf4a76d
Parent:   83a617670da618f4dbdeeebbdb5e2813a4ad2c0c
Author:   qulogic at pidgin.im
Date:     02/03/12 01:04:05
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b6bd214d29db885c6d28628c163fa144bdf4a76d

Changelog: 

Send circle authentication on the notification server on MSNP18.

Changes against parent 83a617670da618f4dbdeeebbdb5e2813a4ad2c0c

  patched  libpurple/protocols/msn/contact.c
  patched  libpurple/protocols/msn/notification.c
  patched  libpurple/protocols/msn/notification.h

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	4096ba6ec4df607ec0b9627bea8b17fcd5f10e42
+++ libpurple/protocols/msn/notification.c	e42c05f79ccbdcf84163f2aab5d8a6f26c5b140e
@@ -1964,6 +1964,22 @@ msn_notification_send_uun(MsnSession *se
 	msn_cmdproc_send_trans(cmdproc, trans);
 }
 
+void
+msn_notification_send_circle_auth(MsnSession *session, const char *ticket)
+{
+	MsnTransaction *trans;
+	MsnCmdProc *cmdproc;
+	char *encoded;
+
+	cmdproc = session->notification->cmdproc;
+
+	encoded = purple_base64_encode((guchar *)ticket, strlen(ticket));
+	trans = msn_transaction_new(cmdproc, "USR", "SHA A %s", encoded);
+	msn_cmdproc_send_trans(cmdproc, trans);
+
+	g_free(encoded);
+}
+
 /**************************************************************************
  * Message Types
  **************************************************************************/
============================================================
--- libpurple/protocols/msn/notification.h	646dbe9cdb9300871764ead11e1b441cc69ac5b1
+++ libpurple/protocols/msn/notification.h	39dd417d3a54d9abf5df9f34361f1d6ea1eaacec
@@ -108,6 +108,8 @@ void msn_notification_send_uun(MsnSessio
                                MsnUnifiedNotificationType type,
                                const char *payload);
 
+void msn_notification_send_circle_auth(MsnSession *session, const char *ticket);
+
 /**
  * Closes a notification.
  *
============================================================
--- libpurple/protocols/msn/contact.c	f29c066bab724840058c0ac05fbabaa623ce3be5
+++ libpurple/protocols/msn/contact.c	a794fa9d8689f0ae66877ecb7e0d7b0e8f9e407e
@@ -871,6 +871,7 @@ msn_parse_addressbook(MsnSession *sessio
 	xmlnode *groups;
 	xmlnode *contacts;
 	xmlnode *abNode;
+	xmlnode *circleNode;
 	xmlnode *fault;
 
 	if ((fault = xmlnode_get_child(node, "Body/Fault"))) {
@@ -954,6 +955,15 @@ msn_parse_addressbook(MsnSession *sessio
 		g_free(tmp);
 	}
 
+	circleNode = xmlnode_get_child(result, "CircleResult/CircleTicket");
+	if (circleNode != NULL && session->protocol_ver >= 18) {
+		char *data;
+
+		data = xmlnode_get_data(circleNode);
+		msn_notification_send_circle_auth(session, data);
+		g_free(data);
+	}
+
 	return TRUE;
 }
 


More information about the Commits mailing list