changeset 29225:42b47f88f6e1

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.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 01 Jan 2010 22:05:40 +0000
parents 7aef89b92589
children 34594f33c72e
files libpurple/protocols/msn/msn.c
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Fri Jan 01 21:55:01 2010 +0000
+++ b/libpurple/protocols/msn/msn.c	Fri Jan 01 22:05:40 2010 +0000
@@ -1543,6 +1543,8 @@
 {
 	const char *bname;
 	MsnAddReqData *data;
+	MsnSession *session;
+	MsnUser *user;
 
 	bname = purple_buddy_get_name(buddy);
 
@@ -1564,12 +1566,18 @@
 	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