comparison src/protocols/msn/msn.c @ 4349:0c68d402f59f

[gaim-migrate @ 4614] XML Blist Gaim stores all the buddy lists in one big happy file now. You can order the buddies however you want, and they'll stay ordered that way. We can also store some per-buddy information now, which will be cool. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 19 Jan 2003 22:16:52 +0000
parents cc2f780c0505
children 5fb47ec9bfe4
comparison
equal deleted inserted replaced
4348:922b66840a51 4349:0c68d402f59f
486 char msgbuf[256]; 486 char msgbuf[256];
487 const char *username; 487 const char *username;
488 struct conversation *cnv; 488 struct conversation *cnv;
489 struct buddy *b; 489 struct buddy *b;
490 490
491 if ((b = find_buddy(gc, user)) != NULL) 491 if ((b = find_buddy(gc->user, user)) != NULL)
492 username = get_buddy_alias(b); 492 username = get_buddy_alias(b);
493 else 493 else
494 username = user; 494 username = user;
495 495
496 g_snprintf(msgbuf, sizeof(msgbuf), 496 g_snprintf(msgbuf, sizeof(msgbuf),
1081 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1081 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1082 hide_login_progress(map->gc, _("Write error")); 1082 hide_login_progress(map->gc, _("Write error"));
1083 signoff(map->gc); 1083 signoff(map->gc);
1084 return; 1084 return;
1085 } 1085 }
1086 map->gc->permit = g_slist_append(map->gc->permit, map->user); 1086 gaim_privacy_permit_add(map->gc->user, map->user);
1087 build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */ 1087 build_allow_list(); /* er. right. we'll need to have a thing for this in CUI too */
1088 show_got_added(map->gc, NULL, map->user, map->friend, NULL); 1088 show_got_added(map->gc, NULL, map->user, map->friend, NULL);
1089 } 1089 }
1090 1090
1091 g_free(map->user); 1091 g_free(map->user);
1103 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 1103 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
1104 hide_login_progress(map->gc, _("Write error")); 1104 hide_login_progress(map->gc, _("Write error"));
1105 signoff(map->gc); 1105 signoff(map->gc);
1106 return; 1106 return;
1107 } 1107 }
1108 map->gc->deny = g_slist_append(map->gc->deny, map->user); 1108 gaim_privacy_deny_add(map->gc->user, map->user);
1109 build_block_list(); 1109 build_block_list();
1110 } 1110 }
1111 1111
1112 g_free(map->user); 1112 g_free(map->user);
1113 g_free(map->friend); 1113 g_free(map->friend);
1120 char sendbuf[MSN_BUF_LEN]; 1120 char sendbuf[MSN_BUF_LEN];
1121 1121
1122 if (!g_strncasecmp(buf, "ADD", 3)) { 1122 if (!g_strncasecmp(buf, "ADD", 3)) {
1123 char *list, *user, *friend, *tmp = buf; 1123 char *list, *user, *friend, *tmp = buf;
1124 struct msn_add_permit *ap; 1124 struct msn_add_permit *ap;
1125 GSList *perm = gc->permit; 1125 GSList *perm = gc->user->permit;
1126 char msg[MSN_BUF_LEN]; 1126 char msg[MSN_BUF_LEN];
1127 1127
1128 GET_NEXT(tmp); 1128 GET_NEXT(tmp);
1129 GET_NEXT(tmp); 1129 GET_NEXT(tmp);
1130 list = tmp; 1130 list = tmp;
1165 if (!g_strcasecmp(type, "AL")) { 1165 if (!g_strcasecmp(type, "AL")) {
1166 /* If the current setting is AL, messages 1166 /* If the current setting is AL, messages
1167 * from users who are not in BL will be delivered 1167 * from users who are not in BL will be delivered
1168 * 1168 *
1169 * In other words, deny some */ 1169 * In other words, deny some */
1170 gc->permdeny = DENY_SOME; 1170 gc->user->permdeny = DENY_SOME;
1171 } else { 1171 } else {
1172 /* If the current 1172 /* If the current
1173 * setting is BL, only messages from people who are in the AL will be 1173 * setting is BL, only messages from people who are in the AL will be
1174 * delivered. 1174 * delivered.
1175 * 1175 *
1176 * In other words, permit some */ 1176 * In other words, permit some */
1177 gc->permdeny = PERMIT_SOME; 1177 gc->user->permdeny = PERMIT_SOME;
1178 } 1178 }
1179 } else if (!g_strncasecmp(buf, "BPR", 3)) { 1179 } else if (!g_strncasecmp(buf, "BPR", 3)) {
1180 } else if (!g_strncasecmp(buf, "CHG", 3)) { 1180 } else if (!g_strncasecmp(buf, "CHG", 3)) {
1181 } else if (!g_strncasecmp(buf, "CHL", 3)) { 1181 } else if (!g_strncasecmp(buf, "CHL", 3)) {
1182 char *hash = buf; 1182 char *hash = buf;
1245 1245
1246 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); 1246 serv_got_update(gc, user, 1, 0, 0, 0, status, 0);
1247 } else if (!g_strncasecmp(buf, "LST", 3)) { 1247 } else if (!g_strncasecmp(buf, "LST", 3)) {
1248 char *which, *who, *friend, *tmp = buf; 1248 char *which, *who, *friend, *tmp = buf;
1249 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! */ 1249 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! */
1250 GSList *perm = gc->permit; /* current permit list */ 1250 GSList *perm = gc->user->permit; /* current permit list */
1251 GSList *denyl = gc->deny; 1251 GSList *denyl = gc->user->deny;
1252 char msg[MSN_BUF_LEN]; 1252 char msg[MSN_BUF_LEN];
1253 int new = 1; 1253 int new = 1;
1254 int pos, tot; 1254 int pos, tot;
1255 1255
1256 GET_NEXT(tmp); 1256 GET_NEXT(tmp);
1272 struct msn_buddy *b = g_new0(struct msn_buddy, 1); 1272 struct msn_buddy *b = g_new0(struct msn_buddy, 1);
1273 b->user = g_strdup(who); 1273 b->user = g_strdup(who);
1274 b->friend = g_strdup(friend); 1274 b->friend = g_strdup(friend);
1275 md->fl = g_slist_append(md->fl, b); 1275 md->fl = g_slist_append(md->fl, b);
1276 } else if (!g_strcasecmp(which, "AL") && pos) { 1276 } else if (!g_strcasecmp(which, "AL") && pos) {
1277 char *dupl; 1277 if (g_slist_find_custom(gc->user->deny, who,
1278 if ((dupl = (char *)g_slist_find_custom(gc->deny, who, 1278 (GCompareFunc)strcmp)) {
1279 (GCompareFunc)strcmp))) {
1280 debug_printf("moving from deny to permit: %s", who); 1279 debug_printf("moving from deny to permit: %s", who);
1281 gc->deny = g_slist_remove(gc->deny, dupl); 1280 gaim_privacy_deny_remove(gc->user, who);
1282 } 1281 }
1283 gc->permit = g_slist_append(gc->permit, g_strdup(who)); 1282 gaim_privacy_permit_add(gc->user, who);
1284 } else if (!g_strcasecmp(which, "BL") && pos) { 1283 } else if (!g_strcasecmp(which, "BL") && pos) {
1285 gc->deny = g_slist_append(gc->deny, g_strdup(who)); 1284 gaim_privacy_deny_remove(gc->user, who);
1286 } else if (!g_strcasecmp(which, "RL")) { 1285 } else if (!g_strcasecmp(which, "RL")) {
1287 if (pos) { 1286 if (pos) {
1288 while(perm) { 1287 while(perm) {
1289 if(!g_strcasecmp(perm->data, who)) 1288 if(!g_strcasecmp(perm->data, who))
1290 new = 0; 1289 new = 0;
1318 } 1317 }
1319 1318
1320 account_online(gc); 1319 account_online(gc);
1321 serv_finish_login(gc); 1320 serv_finish_login(gc);
1322 1321
1323 md->permit = g_slist_copy(gc->permit); 1322 md->permit = g_slist_copy(gc->user->permit);
1324 md->deny = g_slist_copy(gc->deny); 1323 md->deny = g_slist_copy(gc->user->deny);
1325 1324
1326 if (bud_list_cache_exists(gc))
1327 do_import(gc, NULL);
1328 else {
1329 g_snprintf(sendbuf, sizeof(sendbuf), "BLP %u AL\r\n", ++md->trId);
1330 if (msn_write(md->fd, sendbuf, strlen(sendbuf)) < 0) {
1331 hide_login_progress(gc, _("Unable to write"));
1332 signoff(gc);
1333 return 0;
1334 }
1335 }
1336 while (md->fl) { 1325 while (md->fl) {
1337 struct msn_buddy *mb = md->fl->data; 1326 struct msn_buddy *mb = md->fl->data;
1338 struct buddy *b = find_buddy(gc, mb->user); 1327 struct buddy *b = find_buddy(gc->user, mb->user);
1339 md->fl = g_slist_remove(md->fl, mb); 1328 md->fl = g_slist_remove(md->fl, mb);
1340 if(!b) 1329 if(!b)
1341 b = add_buddy(gc, _("Buddies"), mb->user, NULL); 1330 b = add_buddy(gc->user, _("Buddies"), mb->user, NULL);
1342 serv_got_alias(gc, mb->user, mb->friend); 1331 serv_got_alias(gc, mb->user, mb->friend);
1343 g_free(mb->user); 1332 g_free(mb->user);
1344 g_free(mb->friend); 1333 g_free(mb->friend);
1345 g_free(mb); 1334 g_free(mb);
1346 } 1335 }
2456 2445
2457 static GList *msn_buddy_menu(struct gaim_connection *gc, char *who) 2446 static GList *msn_buddy_menu(struct gaim_connection *gc, char *who)
2458 { 2447 {
2459 GList *m = NULL; 2448 GList *m = NULL;
2460 struct proto_buddy_menu *pbm; 2449 struct proto_buddy_menu *pbm;
2461 struct buddy *b = find_buddy(gc, who); 2450 struct buddy *b = find_buddy(gc->user, who);
2462 static char buf[MSN_BUF_LEN]; 2451 static char buf[MSN_BUF_LEN];
2463 2452
2464 pbm = g_new0(struct proto_buddy_menu, 1); 2453 pbm = g_new0(struct proto_buddy_menu, 1);
2465 pbm->label = _("Send File"); 2454 pbm->label = _("Send File");
2466 pbm->callback = msn_ask_send_file; 2455 pbm->callback = msn_ask_send_file;
2602 { 2591 {
2603 struct msn_data *md = gc->proto_data; 2592 struct msn_data *md = gc->proto_data;
2604 char buf[MSN_BUF_LEN]; 2593 char buf[MSN_BUF_LEN];
2605 GSList *s, *t = NULL; 2594 GSList *s, *t = NULL;
2606 2595
2607 if (gc->permdeny == PERMIT_ALL || gc->permdeny == DENY_SOME) 2596 if (gc->user->permdeny == PERMIT_ALL || gc->user->permdeny == DENY_SOME)
2608 g_snprintf(buf, sizeof(buf), "BLP %u AL\r\n", ++md->trId); 2597 g_snprintf(buf, sizeof(buf), "BLP %u AL\r\n", ++md->trId);
2609 else 2598 else
2610 g_snprintf(buf, sizeof(buf), "BLP %u BL\r\n", ++md->trId); 2599 g_snprintf(buf, sizeof(buf), "BLP %u BL\r\n", ++md->trId);
2611 2600
2612 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2601 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2616 } 2605 }
2617 2606
2618 /* this is safe because we'll always come here after we've gotten the list off the server, 2607 /* this is safe because we'll always come here after we've gotten the list off the server,
2619 * and data is never removed. So if the lengths are equal we don't know about anyone locally 2608 * and data is never removed. So if the lengths are equal we don't know about anyone locally
2620 * and so there's no sense in going through them all. */ 2609 * and so there's no sense in going through them all. */
2621 if (g_slist_length(gc->permit) == g_slist_length(md->permit)) { 2610 if (g_slist_length(gc->user->permit) == g_slist_length(md->permit)) {
2622 g_slist_free(md->permit); 2611 g_slist_free(md->permit);
2623 md->permit = NULL; 2612 md->permit = NULL;
2624 } 2613 }
2625 if (g_slist_length(gc->deny) == g_slist_length(md->deny)) { 2614 if (g_slist_length(gc->user->deny) == g_slist_length(md->deny)) {
2626 g_slist_free(md->deny); 2615 g_slist_free(md->deny);
2627 md->deny = NULL; 2616 md->deny = NULL;
2628 } 2617 }
2629 if (!md->permit && !md->deny) 2618 if (!md->permit && !md->deny)
2630 return; 2619 return;
2631 2620
2632 if (md->permit) { 2621 if (md->permit) {
2633 s = g_slist_nth(gc->permit, g_slist_length(md->permit)); 2622 s = g_slist_nth(gc->user->permit, g_slist_length(md->permit));
2634 while (s) { 2623 while (s) {
2635 char *who = s->data; 2624 char *who = s->data;
2636 char *dupl;
2637 s = s->next; 2625 s = s->next;
2638 if (!strchr(who, '@')) { 2626 if (!strchr(who, '@')) {
2639 t = g_slist_append(t, who); 2627 t = g_slist_append(t, who);
2640 continue; 2628 continue;
2641 } 2629 }
2642 if ((dupl = (char *)g_slist_find(md->deny, who))) { 2630 if (g_slist_find(md->deny, who)) {
2643 t = g_slist_append(t, who); 2631 t = g_slist_append(t, who);
2644 continue; 2632 continue;
2645 } 2633 }
2646 g_snprintf(buf, sizeof(buf), "ADD %u AL %s %s\r\n", ++md->trId, who, who); 2634 g_snprintf(buf, sizeof(buf), "ADD %u AL %s %s\r\n", ++md->trId, who, who);
2647 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2635 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2649 signoff(gc); 2637 signoff(gc);
2650 return; 2638 return;
2651 } 2639 }
2652 } 2640 }
2653 while (t) { 2641 while (t) {
2654 char *who = t->data; 2642 gaim_privacy_permit_remove(gc->user, t->data);
2655 gc->permit = g_slist_remove(gc->permit, who);
2656 g_free(who);
2657 t = t->next; 2643 t = t->next;
2658 } 2644 }
2659 if (t) 2645 if (t)
2660 g_slist_free(t); 2646 g_slist_free(t);
2661 t = NULL; 2647 t = NULL;
2662 g_slist_free(md->permit); 2648 g_slist_free(md->permit);
2663 md->permit = NULL; 2649 md->permit = NULL;
2664 } 2650 }
2665 2651
2666 if (md->deny) { 2652 if (md->deny) {
2667 s = g_slist_nth(gc->deny, g_slist_length(md->deny)); 2653 s = g_slist_nth(gc->user->deny, g_slist_length(md->deny));
2668 while (s) { 2654 while (s) {
2669 char *who = s->data; 2655 char *who = s->data;
2670 char *dupl;
2671 s = s->next; 2656 s = s->next;
2672 if (!strchr(who, '@')) { 2657 if (!strchr(who, '@')) {
2673 t = g_slist_append(t, who); 2658 t = g_slist_append(t, who);
2674 continue; 2659 continue;
2675 } 2660 }
2676 if ((dupl = (char *)g_slist_find(md->deny, who))) { 2661 if (g_slist_find(md->deny, who)) {
2677 t = g_slist_append(t, who); 2662 t = g_slist_append(t, who);
2678 continue; 2663 continue;
2679 } 2664 }
2680 g_snprintf(buf, sizeof(buf), "ADD %u BL %s %s\r\n", ++md->trId, who, who); 2665 g_snprintf(buf, sizeof(buf), "ADD %u BL %s %s\r\n", ++md->trId, who, who);
2681 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2666 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2683 signoff(gc); 2668 signoff(gc);
2684 return; 2669 return;
2685 } 2670 }
2686 } 2671 }
2687 while (t) { 2672 while (t) {
2688 char *who = t->data; 2673 gaim_privacy_deny_remove(gc->user, t->data);
2689 gc->deny = g_slist_remove(gc->deny, who);
2690 g_free(who);
2691 t = t->next; 2674 t = t->next;
2692 } 2675 }
2693 if (t) 2676 if (t)
2694 g_slist_free(t); 2677 g_slist_free(t);
2695 g_slist_free(md->deny); 2678 g_slist_free(md->deny);
2696 md->deny = NULL; 2679 md->deny = NULL;
2697 } 2680 }
2698 } 2681 }
2699 2682
2700 static void msn_add_permit(struct gaim_connection *gc, char *who) 2683 static void msn_add_permit(struct gaim_connection *gc, const char *who)
2701 { 2684 {
2702 struct msn_data *md = gc->proto_data; 2685 struct msn_data *md = gc->proto_data;
2703 char buf[MSN_BUF_LEN]; 2686 char buf[MSN_BUF_LEN];
2704 char *dupl;
2705 2687
2706 if (!strchr(who, '@')) { 2688 if (!strchr(who, '@')) {
2707 g_snprintf(buf, sizeof(buf), 2689 g_snprintf(buf, sizeof(buf),
2708 _("An MSN screenname must be in the form \"user@server.com\". " 2690 _("An MSN screenname must be in the form \"user@server.com\". "
2709 "Perhaps you meant %s@hotmail.com. No changes were made to your " 2691 "Perhaps you meant %s@hotmail.com. No changes were made to your "
2710 "allow list."), who); 2692 "allow list."), who);
2711 do_error_dialog(_("Invalid MSN screenname"), buf, GAIM_ERROR); 2693 do_error_dialog(_("Invalid MSN screenname"), buf, GAIM_ERROR);
2712 gc->permit = g_slist_remove(gc->permit, who); 2694 gaim_privacy_permit_remove(gc->user, who);
2713 g_free(who); 2695 return;
2714 return; 2696 }
2715 } 2697
2716 2698 if (g_slist_find_custom(gc->user->deny, who, (GCompareFunc)strcmp)) {
2717 if ((dupl = (char *)g_slist_find_custom(gc->deny, who,
2718 (GCompareFunc)strcmp))) {
2719 debug_printf("MSN: Moving %s from BL to AL\n", who); 2699 debug_printf("MSN: Moving %s from BL to AL\n", who);
2720 gc->deny = g_slist_remove(gc->deny, dupl); 2700 gaim_privacy_deny_remove(gc->user, who);
2721 g_snprintf(buf, sizeof(buf), "REM %u BL %s\r\n", ++md->trId, who); 2701 g_snprintf(buf, sizeof(buf), "REM %u BL %s\r\n", ++md->trId, who);
2722 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2702 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2723 hide_login_progress(gc, _("Write error")); 2703 hide_login_progress(gc, _("Write error"));
2724 signoff(gc); 2704 signoff(gc);
2725 return; 2705 return;
2731 signoff(gc); 2711 signoff(gc);
2732 return; 2712 return;
2733 } 2713 }
2734 } 2714 }
2735 2715
2736 static void msn_rem_permit(struct gaim_connection *gc, char *who) 2716 static void msn_rem_permit(struct gaim_connection *gc, const char *who)
2737 { 2717 {
2738 struct msn_data *md = gc->proto_data; 2718 struct msn_data *md = gc->proto_data;
2739 char buf[MSN_BUF_LEN]; 2719 char buf[MSN_BUF_LEN];
2740 2720
2741 g_snprintf(buf, sizeof(buf), "REM %u AL %s\r\n", ++md->trId, who); 2721 g_snprintf(buf, sizeof(buf), "REM %u AL %s\r\n", ++md->trId, who);
2742 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2722 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2743 hide_login_progress(gc, _("Write error")); 2723 hide_login_progress(gc, _("Write error"));
2744 signoff(gc); 2724 signoff(gc);
2745 return; 2725 return;
2746 } 2726 }
2747 2727
2748 g_slist_append(gc->deny, who); 2728 gaim_privacy_deny_add(gc->user, who);
2749 g_snprintf(buf, sizeof(buf), "ADD %u BL %s %s\r\n", ++md->trId, who, who); 2729 g_snprintf(buf, sizeof(buf), "ADD %u BL %s %s\r\n", ++md->trId, who, who);
2750 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2730 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2751 hide_login_progress(gc, _("Write error")); 2731 hide_login_progress(gc, _("Write error"));
2752 signoff(gc); 2732 signoff(gc);
2753 return; 2733 return;
2754 } 2734 }
2755 } 2735 }
2756 2736
2757 static void msn_add_deny(struct gaim_connection *gc, char *who) 2737 static void msn_add_deny(struct gaim_connection *gc, const char *who)
2758 { 2738 {
2759 struct msn_data *md = gc->proto_data; 2739 struct msn_data *md = gc->proto_data;
2760 char buf[MSN_BUF_LEN]; 2740 char buf[MSN_BUF_LEN];
2761 char *dupl; 2741
2762
2763 if (!strchr(who, '@')) { 2742 if (!strchr(who, '@')) {
2764 g_snprintf(buf, sizeof(buf), 2743 g_snprintf(buf, sizeof(buf),
2765 _("An MSN screenname must be in the form \"user@server.com\". " 2744 _("An MSN screenname must be in the form \"user@server.com\". "
2766 "Perhaps you meant %s@hotmail.com. No changes were made to your " 2745 "Perhaps you meant %s@hotmail.com. No changes were made to your "
2767 "block list."), who); 2746 "block list."), who);
2768 do_error_dialog(_("Invalid MSN screenname"), buf, GAIM_ERROR); 2747 do_error_dialog(_("Invalid MSN screenname"), buf, GAIM_ERROR);
2769 gc->deny = g_slist_remove(gc->deny, who); 2748 gaim_privacy_deny_remove(gc->user, who);
2770 g_free(who); 2749 return;
2771 return; 2750 }
2772 } 2751
2773 2752 if (g_slist_find_custom(gc->user->permit, who, (GCompareFunc)strcmp)) {
2774 if ((dupl = (char *)g_slist_find_custom(gc->permit, who,
2775 (GCompareFunc)strcmp))) {
2776 debug_printf("MSN: Moving %s from AL to BL\n", who); 2753 debug_printf("MSN: Moving %s from AL to BL\n", who);
2777 gc->permit = g_slist_remove(gc->permit, dupl); 2754 gaim_privacy_permit_remove(gc->user, who);
2778 g_snprintf(buf, sizeof(buf), "REM %u AL %s\r\n", ++md->trId, who); 2755 g_snprintf(buf, sizeof(buf), "REM %u AL %s\r\n", ++md->trId, who);
2779 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2756 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2780 hide_login_progress(gc, _("Write error")); 2757 hide_login_progress(gc, _("Write error"));
2781 signoff(gc); 2758 signoff(gc);
2782 return; 2759 return;
2783 } 2760 }
2784 } 2761 }
2785 2762
2786 2763
2787 g_snprintf(buf, sizeof(buf), "ADD %u BL %s %s\r\n", ++md->trId, who, who); 2764 g_snprintf(buf, sizeof(buf), "ADD %u BL %s %s\r\n", ++md->trId, who, who);
2788 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2765 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2789 hide_login_progress(gc, _("Write error")); 2766 hide_login_progress(gc, _("Write error"));
2790 signoff(gc); 2767 signoff(gc);
2791 return; 2768 return;
2792 } 2769 }
2793 } 2770 }
2794 2771
2795 static void msn_rem_deny(struct gaim_connection *gc, char *who) 2772 static void msn_rem_deny(struct gaim_connection *gc, const char *who)
2796 { 2773 {
2797 struct msn_data *md = gc->proto_data; 2774 struct msn_data *md = gc->proto_data;
2798 char buf[MSN_BUF_LEN]; 2775 char buf[MSN_BUF_LEN];
2799 2776
2800 g_snprintf(buf, sizeof(buf), "REM %u BL %s\r\n", ++md->trId, who); 2777 g_snprintf(buf, sizeof(buf), "REM %u BL %s\r\n", ++md->trId, who);
2801 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2778 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2802 hide_login_progress(gc, _("Write error")); 2779 hide_login_progress(gc, _("Write error"));
2803 signoff(gc); 2780 signoff(gc);
2804 return; 2781 return;
2805 } 2782 }
2806 2783
2807 g_slist_append(gc->permit, who); 2784 gaim_privacy_permit_add(gc->user, who);
2808 g_snprintf(buf, sizeof(buf), "ADD %u AL %s %s\r\n", ++md->trId, who, who); 2785 g_snprintf(buf, sizeof(buf), "ADD %u AL %s %s\r\n", ++md->trId, who, who);
2809 if (msn_write(md->fd, buf, strlen(buf)) < 0) { 2786 if (msn_write(md->fd, buf, strlen(buf)) < 0) {
2810 hide_login_progress(gc, _("Write error")); 2787 hide_login_progress(gc, _("Write error"));
2811 signoff(gc); 2788 signoff(gc);
2812 return; 2789 return;