pidgin: bfe07b21: Don't bother asking for an authorization...

qulogic at pidgin.im qulogic at pidgin.im
Fri Jan 1 17:45:52 EST 2010


-----------------------------------------------------------------
Revision: bfe07b21e4cfdeed6045448391d059ac8edcec37
Ancestor: bf154820af21e858c47a0a54c7656ee487a8d597
Author: qulogic at pidgin.im
Date: 2010-01-01T22:05:40
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/bfe07b21e4cfdeed6045448391d059ac8edcec37

Modified files:
        libpurple/protocols/msn/msn.c

ChangeLog: 

Don't bother asking for an authorization message for users that added us to
their own buddy list. I don't think they even receive it anyway.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	fed3a049ae956ae48a7b37a9a01305e16991db88
+++ libpurple/protocols/msn/msn.c	776ce58ee57b9df526b23d66f06fc7024c14a7c5
@@ -1543,6 +1543,8 @@ msn_add_buddy(PurpleConnection *gc, Purp
 {
 	const char *bname;
 	MsnAddReqData *data;
+	MsnSession *session;
+	MsnUser *user;
 
 	bname = purple_buddy_get_name(buddy);
 
@@ -1564,12 +1566,18 @@ msn_add_buddy(PurpleConnection *gc, Purp
 	data->buddy = buddy;
 	data->group = group;
 
-	purple_request_input(gc, NULL, _("Authorization Request Message:"),
-	                     NULL, _("Please authorize me!"), TRUE, FALSE, NULL,
-	                     _("_OK"), G_CALLBACK(finish_auth_request),
-	                     _("_Cancel"), G_CALLBACK(cancel_auth_request),
-	                     purple_connection_get_account(gc), bname, NULL,
-	                     data);
+	session = purple_connection_get_protocol_data(gc);
+	user = msn_userlist_find_user(session->userlist, bname);
+	if (user && user->authorized) {
+		finish_auth_request(data, NULL);
+	} else {
+		purple_request_input(gc, NULL, _("Authorization Request Message:"),
+		                     NULL, _("Please authorize me!"), TRUE, FALSE, NULL,
+		                     _("_OK"), G_CALLBACK(finish_auth_request),
+		                     _("_Cancel"), G_CALLBACK(cancel_auth_request),
+		                     purple_connection_get_account(gc), bname, NULL,
+		                     data);
+	}
 }
 
 static void


More information about the Commits mailing list