# HG changeset patch # User Elliott Sales de Andrade # Date 1328249045 0 # Node ID 760fd1f86a54b00ba22393b5f5683982e2e54c6c # Parent ab9025b4613428d749c0848f609541ae6cce5419 Send circle authentication on the notification server on MSNP18. diff -r ab9025b46134 -r 760fd1f86a54 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Fri Feb 03 04:57:18 2012 +0000 +++ b/libpurple/protocols/msn/contact.c Fri Feb 03 06:04:05 2012 +0000 @@ -871,6 +871,7 @@ xmlnode *groups; xmlnode *contacts; xmlnode *abNode; + xmlnode *circleNode; xmlnode *fault; if ((fault = xmlnode_get_child(node, "Body/Fault"))) { @@ -954,6 +955,15 @@ 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; } diff -r ab9025b46134 -r 760fd1f86a54 libpurple/protocols/msn/notification.c --- a/libpurple/protocols/msn/notification.c Fri Feb 03 04:57:18 2012 +0000 +++ b/libpurple/protocols/msn/notification.c Fri Feb 03 06:04:05 2012 +0000 @@ -1964,6 +1964,22 @@ 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 **************************************************************************/ diff -r ab9025b46134 -r 760fd1f86a54 libpurple/protocols/msn/notification.h --- a/libpurple/protocols/msn/notification.h Fri Feb 03 04:57:18 2012 +0000 +++ b/libpurple/protocols/msn/notification.h Fri Feb 03 06:04:05 2012 +0000 @@ -108,6 +108,8 @@ MsnUnifiedNotificationType type, const char *payload); +void msn_notification_send_circle_auth(MsnSession *session, const char *ticket); + /** * Closes a notification. *