pidgin: e7ce67e5: Fix denying auth requests from MSN buddi...

sadrul at pidgin.im sadrul at pidgin.im
Thu Jul 9 15:35:27 EDT 2009


-----------------------------------------------------------------
Revision: e7ce67e5153d7d547ecebe9b330a5922376494c4
Ancestor: dddfde8f4d668612cab0093528f9bd0323979050
Author: sadrul at pidgin.im
Date: 2009-07-09T17:57:44
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e7ce67e5153d7d547ecebe9b330a5922376494c4

Modified files:
        libpurple/protocols/yahoo/libymsg.c

ChangeLog: 

Fix denying auth requests from MSN buddies, and fix a leak.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	31690267f43b0e6ad907781dd92379bf2f6eca70
+++ libpurple/protocols/yahoo/libymsg.c	79130fd4a2810eb0eee56e0654185eae514f6721
@@ -1163,17 +1163,21 @@ yahoo_buddy_add_deny_cb(struct yahoo_add
 	struct yahoo_data *yd = add_req->gc->proto_data;
 	struct yahoo_packet *pkt;
 	char *encoded_msg = NULL;
-	PurpleAccount *account = purple_connection_get_account(add_req->gc);
+	const char *who = add_req->who;
 
+	if (add_req->protocol == 2)
+		who += 4; /* Skip 'msn/' */
+
 	if (msg && *msg)
 		encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
 			YAHOO_STATUS_AVAILABLE, 0);
 
-	yahoo_packet_hash(pkt, "ssiiis",
-			1, purple_normalize(account, purple_account_get_username(account)),
-			5, add_req->who,
+	yahoo_packet_hash(pkt, "ssiiiis",
+			1, add_req->id,
+			5, who,
+			241, add_req->protocol,
 			13, 2,
 			334, 0,
 			97, 1,
@@ -1291,7 +1295,6 @@ static void yahoo_buddy_auth_req_15(Purp
 			switch (pair->key) {
 			case 4:
 				temp = pair->value;
-				add_req->who = g_strdup(pair->value);
 				break;
 			case 5:
 				add_req->id = g_strdup(pair->value);


More information about the Commits mailing list