changeset 25006:032651900c32

Oscar: Re-request authorization when adding a buddy that is already on the list. This might want to simply call purple_auth_request instead of popping up the request dialog again. I'm not sure which is better.
author Paul Aurich <paul@darkrain42.org>
date Sun, 21 Dec 2008 19:15:21 +0000
parents 401f548e3544
children 071414f413a4
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Sun Dec 21 18:32:37 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sun Dec 21 19:15:21 2008 +0000
@@ -4814,19 +4814,26 @@
 		return;
 	}
 
-	if ((od->ssi.received_data) && !(aim_ssi_itemlist_finditem(od->ssi.local, group->name, buddy->name, AIM_SSI_TYPE_BUDDY))) {
-		purple_debug_info("oscar",
-				   "ssi: adding buddy %s to group %s\n", buddy->name, group->name);
-		aim_ssi_addbuddy(od, buddy->name, group->name, NULL, purple_buddy_get_alias_only(buddy), NULL, NULL, 0);
-
-		/* Mobile users should always be online */
-		if (buddy->name[0] == '+') {
-			purple_prpl_got_user_status(account,
-					purple_buddy_get_name(buddy),
-					OSCAR_STATUS_ID_AVAILABLE, NULL);
-			purple_prpl_got_user_status(account,
-					purple_buddy_get_name(buddy),
-					OSCAR_STATUS_ID_MOBILE, NULL);
+	if (od->ssi.received_data) {
+		if (!aim_ssi_itemlist_finditem(od->ssi.local, group->name, buddy->name, AIM_SSI_TYPE_BUDDY)) {
+			purple_debug_info("oscar",
+					   "ssi: adding buddy %s to group %s\n", buddy->name, group->name);
+			aim_ssi_addbuddy(od, buddy->name, group->name, NULL, purple_buddy_get_alias_only(buddy), NULL, NULL, 0);
+
+			/* Mobile users should always be online */
+			if (buddy->name[0] == '+') {
+				purple_prpl_got_user_status(account,
+						purple_buddy_get_name(buddy),
+						OSCAR_STATUS_ID_AVAILABLE, NULL);
+				purple_prpl_got_user_status(account,
+						purple_buddy_get_name(buddy),
+						OSCAR_STATUS_ID_MOBILE, NULL);
+			}
+		} else if (aim_ssi_waitingforauth(od->ssi.local,
+		                                  aim_ssi_itemlist_findparentname(od->ssi.local, purple_buddy_get_name(buddy)),
+		                                  purple_buddy_get_name(buddy))) {
+			/* Not authorized -- Re-request authorization */
+			purple_auth_sendrequest(gc, purple_buddy_get_name(buddy));
 		}
 	}