comparison 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
comparison
equal deleted inserted replaced
3011:c809f2ed3d92 3012:08327a2f25aa
697 hide_login_progress(map->gc, "Write error"); 697 hide_login_progress(map->gc, "Write error");
698 signoff(map->gc); 698 signoff(map->gc);
699 return; 699 return;
700 } 700 }
701 build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */ 701 build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */
702
703 show_got_added(map->gc, NULL, map->user, map->friend, NULL); 702 show_got_added(map->gc, NULL, map->user, map->friend, NULL);
704 } 703 }
705 704
706 static void msn_cancel_add(gpointer w, struct msn_add_permit *map) 705 static void msn_cancel_add(gpointer w, struct msn_add_permit *map)
707 { 706 {
845 } 844 }
846 845
847 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); 846 serv_got_update(gc, user, 1, 0, 0, 0, status, 0);
848 } else if (!g_strncasecmp(buf, "LST", 3)) { 847 } else if (!g_strncasecmp(buf, "LST", 3)) {
849 char *which, *who, *friend, *tmp = buf; 848 char *which, *who, *friend, *tmp = buf;
849 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! */
850 GSList *perm = gc->permit; /* current permit list */
851 char msg[MSN_BUF_LEN];
852 int new = 1;
850 int pos, tot; 853 int pos, tot;
851 854
852 GET_NEXT(tmp); 855 GET_NEXT(tmp);
853 GET_NEXT(tmp); 856 GET_NEXT(tmp);
854 which = tmp; 857 which = tmp;
872 } else if (!g_strcasecmp(which, "AL") && pos) { 875 } else if (!g_strcasecmp(which, "AL") && pos) {
873 gc->permit = g_slist_append(gc->permit, g_strdup(who)); 876 gc->permit = g_slist_append(gc->permit, g_strdup(who));
874 } else if (!g_strcasecmp(which, "BL") && pos) { 877 } else if (!g_strcasecmp(which, "BL") && pos) {
875 gc->deny = g_slist_append(gc->deny, g_strdup(who)); 878 gc->deny = g_slist_append(gc->deny, g_strdup(who));
876 } else if (!g_strcasecmp(which, "RL")) { 879 } else if (!g_strcasecmp(which, "RL")) {
877 if (pos != tot) 880 while(perm) {
878 return 1; 881 if(!g_strcasecmp(perm->data, who))
882 new = 0;
883 perm = perm->next;
884 }
885
886 if(new) {
887 debug_printf("Unresolved MSN RL entry");
888 ap = g_new0(struct msn_add_permit, 1);
889 ap->user = g_strdup(who);
890 ap->friend = g_strdup(friend);
891 ap->gc = gc;
892
893 g_snprintf(msg, sizeof(msg), "The user %s (%s) wants to add you to their buddy list",ap->user, url_decode(ap->friend));
894 do_ask_dialog(msg, ap, msn_accept_add, msn_cancel_add);
895 }
896
897 if (pos != tot)
898 return 1; /* this isn't the last one in the RL, so return. */
879 899
880 g_snprintf(sendbuf, sizeof(sendbuf), "CHG %d NLN\r\n", ++md->trId); 900 g_snprintf(sendbuf, sizeof(sendbuf), "CHG %d NLN\r\n", ++md->trId);
881 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) { 901 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
882 hide_login_progress(gc, "Unable to write"); 902 hide_login_progress(gc, "Unable to write");
883 signoff(gc); 903 signoff(gc);