diff src/protocols/msn/msn.c @ 3012:08327a2f25aa

[gaim-migrate @ 3025] Lots of people have a problem with people who were added to their MSN reverse list while they were offline, not being prompted to add them to their allow list. Jason Willis fixed that. Also added a global buddy icon animation preference by Luke Schierer. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 06 Mar 2002 00:18:02 +0000
parents 87fff45fa36b
children 47d0f8979fb1
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Tue Mar 05 23:20:51 2002 +0000
+++ b/src/protocols/msn/msn.c	Wed Mar 06 00:18:02 2002 +0000
@@ -699,7 +699,6 @@
 		return;
 	}
 	build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */
-
 	show_got_added(map->gc, NULL, map->user, map->friend, NULL);
 }
 
@@ -847,6 +846,10 @@
 		serv_got_update(gc, user, 1, 0, 0, 0, status, 0);
 	} else if (!g_strncasecmp(buf, "LST", 3)) {
 		char *which, *who, *friend, *tmp = buf;
+		struct msn_add_permit *ap; /* for any as yet undealt with buddies who've added you to their buddy list when you were off-line.  How dare they! */
+		GSList *perm = gc->permit; /* current permit list */
+		char msg[MSN_BUF_LEN];
+		int new = 1;
 		int pos, tot;
 
 		GET_NEXT(tmp);
@@ -874,8 +877,25 @@
 		} else if (!g_strcasecmp(which, "BL") && pos) {
 			gc->deny = g_slist_append(gc->deny, g_strdup(who));
 		} else if (!g_strcasecmp(which, "RL")) {
-			if (pos != tot)
-				return 1;
+			while(perm) {
+				if(!g_strcasecmp(perm->data, who))
+					new = 0;
+				perm = perm->next;
+			}
+
+			if(new) {
+				debug_printf("Unresolved MSN RL entry");
+				ap = g_new0(struct msn_add_permit, 1);
+				ap->user = g_strdup(who);
+				ap->friend = g_strdup(friend);
+				ap->gc = gc;
+                         
+		                g_snprintf(msg, sizeof(msg), "The user %s (%s) wants to add you to their buddy list",ap->user, url_decode(ap->friend));
+				do_ask_dialog(msg, ap, msn_accept_add, msn_cancel_add);
+			}
+			
+			if (pos != tot) 
+				return 1; /* this isn't the last one in the RL, so return. */
 
 			g_snprintf(sendbuf, sizeof(sendbuf), "CHG %d NLN\r\n", ++md->trId);
 			if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {