Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 2995:e27517a5c28e
[gaim-migrate @ 3008]
OSCAR SSI for AIM only, until the ICQ kinks are worked out. Thanks, Mark Doliner.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sun, 03 Mar 2002 02:53:46 +0000 |
parents | 60018f862a51 |
children | 6fe330f1b951 |
comparison
equal
deleted
inserted
replaced
2994:60018f862a51 | 2995:e27517a5c28e |
---|---|
2222 | 2222 |
2223 aim_icq_reqofflinemsgs(sess); | 2223 aim_icq_reqofflinemsgs(sess); |
2224 | 2224 |
2225 aim_reqservice(sess, fr->conn, AIM_CONN_TYPE_CHATNAV); | 2225 aim_reqservice(sess, fr->conn, AIM_CONN_TYPE_CHATNAV); |
2226 | 2226 |
2227 aim_ssi_reqrights(sess, fr->conn); | 2227 if (!odata->icq) |
2228 aim_ssi_reqrights(sess, fr->conn); | |
2228 | 2229 |
2229 return 1; | 2230 return 1; |
2230 } | 2231 } |
2231 | 2232 |
2232 static int gaim_offlinemsg(aim_session_t *sess, aim_frame_t *fr, ...) { | 2233 static int gaim_offlinemsg(aim_session_t *sess, aim_frame_t *fr, ...) { |
2640 aim_usersearch_address(odata->sess, odata->conn, email); | 2641 aim_usersearch_address(odata->sess, odata->conn, email); |
2641 } | 2642 } |
2642 | 2643 |
2643 static void oscar_add_buddy(struct gaim_connection *g, char *name) { | 2644 static void oscar_add_buddy(struct gaim_connection *g, char *name) { |
2644 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | 2645 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
2645 if (odata->sess->ssi.received_data) { | 2646 if (odata->icq) { |
2646 debug_printf("ssi: adding %s to group %s\n", name, find_group_by_buddy(g, name)->name); | 2647 aim_add_buddy(odata->sess, odata->conn, name); |
2647 aim_ssi_addbuddies(odata->sess, odata->conn, find_group_by_buddy(g, name)->name, &name, 1); | 2648 } else { |
2648 } | 2649 if ((odata->sess->ssi.received_data) && !(aim_ssi_inlist(odata->sess, odata->conn, name, 0x0000))) { |
2649 /* aim_add_buddy(odata->sess, odata->conn, name); */ | 2650 debug_printf("ssi: adding buddy %s to group %s\n", name, find_group_by_buddy(g, name)->name); |
2651 aim_ssi_addbuddies(odata->sess, odata->conn, find_group_by_buddy(g, name)->name, &name, 1); | |
2652 } | |
2653 } | |
2650 } | 2654 } |
2651 | 2655 |
2652 static void oscar_add_buddies(struct gaim_connection *g, GList *buddies) { | 2656 static void oscar_add_buddies(struct gaim_connection *g, GList *buddies) { |
2653 char **sns; | |
2654 GSList *grp, *mem; | |
2655 struct group *group; | |
2656 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | 2657 struct oscar_data *odata = (struct oscar_data *)g->proto_data; |
2657 /* char buf[MSG_LEN]; */ | 2658 if (odata->icq) { |
2658 int tmp=0, n=0; | 2659 char buf[MSG_LEN]; |
2659 | 2660 int n=0; |
2660 if (odata->sess->ssi.received_data) { | 2661 while (buddies) { |
2661 for (grp=g->groups; grp; grp=g_slist_next(grp)) { | 2662 if (n > MSG_LEN - 18) { |
2662 group = (struct group*)grp->data; | 2663 aim_bos_setbuddylist(odata->sess, odata->conn, buf); |
2663 tmp = 0; | 2664 n = 0; |
2664 for (mem=group->members; mem; mem=mem->next) | 2665 } |
2665 if (!aim_ssi_inlist(odata->sess, odata->conn, ((struct buddy*)mem->data)->name, 0x0000)) | 2666 n += g_snprintf(buf + n, sizeof(buf) - n, "%s&", (char *)buddies->data); |
2667 buddies = buddies->next; | |
2668 } | |
2669 aim_bos_setbuddylist(odata->sess, odata->conn, buf); | |
2670 } else { | |
2671 if (odata->sess->ssi.received_data) { | |
2672 int tmp; | |
2673 GSList *curgrp, *curbud; | |
2674 for (curgrp=g->groups; curgrp; curgrp=g_slist_next(curgrp)) { | |
2675 tmp = 0; | |
2676 for (curbud=((struct group*)curgrp->data)->members; curbud; curbud=curbud->next) | |
2677 if (!aim_ssi_inlist(odata->sess, odata->conn, ((struct buddy*)curbud->data)->name, 0x0000)) | |
2678 tmp++; | |
2679 if (tmp) { | |
2680 char **sns = (char **)malloc(tmp*sizeof(char*)); | |
2681 tmp = 0; | |
2682 for (curbud=((struct group*)curgrp->data)->members; curbud; curbud=curbud->next) | |
2683 if (!aim_ssi_inlist(odata->sess, odata->conn, ((struct buddy*)curbud->data)->name, 0x0000)) { | |
2684 debug_printf("ssi: adding buddy %s to group %s\n", ((struct buddy*)curbud->data)->name, ((struct group*)curgrp->data)->name); | |
2685 sns[tmp] = (char *)((struct buddy*)curbud->data)->name; | |
2686 tmp++; | |
2687 } | |
2688 aim_ssi_addbuddies(odata->sess, odata->conn, ((struct group*)curgrp->data)->name, sns, tmp); | |
2689 free(sns); | |
2690 } | |
2691 } | |
2692 } | |
2693 } | |
2694 } | |
2695 | |
2696 static void oscar_remove_buddy(struct gaim_connection *g, char *name, char *group) { | |
2697 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | |
2698 if (odata->icq) { | |
2699 aim_remove_buddy(odata->sess, odata->conn, name); | |
2700 } else { | |
2701 if (odata->sess->ssi.received_data) | |
2702 while (aim_ssi_inlist(odata->sess, odata->conn, name, 0x0000) && !aim_ssi_delbuddies(odata->sess, odata->conn, group, &name, 1)) | |
2703 debug_printf("ssi: deleted buddy %s from group %s\n", name, group); | |
2704 } | |
2705 } | |
2706 | |
2707 static void oscar_remove_buddies(struct gaim_connection *g, GList *buddies, char *group) { | |
2708 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | |
2709 if (odata->icq) { | |
2710 GList *cur; | |
2711 for (cur=buddies; cur; cur=cur->next) | |
2712 aim_remove_buddy(odata->sess, odata->conn, cur->data); | |
2713 } else { | |
2714 if (odata->sess->ssi.received_data) { | |
2715 GList *cur; | |
2716 int tmp = 0; | |
2717 for (cur=buddies; cur; cur=cur->next) | |
2718 if (aim_ssi_inlist(odata->sess, odata->conn, cur->data, 0x0000)) | |
2666 tmp++; | 2719 tmp++; |
2667 sns = (char **)malloc(tmp*sizeof(char*)); | |
2668 tmp = 0; | |
2669 for (mem=group->members; mem; mem=mem->next) | |
2670 if (!aim_ssi_inlist(odata->sess, odata->conn, ((struct buddy*)mem->data)->name, 0x0000)) { | |
2671 debug_printf("ssi: adding %s from local list to server list\n", ((struct buddy*)mem->data)->name); | |
2672 sns[tmp] = ((char *)((struct buddy*)mem->data)->name); | |
2673 tmp++; | |
2674 } | |
2675 if (tmp) { | 2720 if (tmp) { |
2676 aim_ssi_addbuddies(odata->sess, odata->conn, group->name, sns, tmp); | 2721 char **sns; |
2722 sns = (char **)malloc(tmp*sizeof(char*)); | |
2723 tmp = 0; | |
2724 for (cur=buddies; cur; cur=cur->next) | |
2725 if (aim_ssi_inlist(odata->sess, odata->conn, cur->data, 0x0000)) { | |
2726 debug_printf("ssi: deleting buddy %s from group %s\n", cur->data, group); | |
2727 sns[tmp] = cur->data; | |
2728 tmp++; | |
2729 } | |
2730 aim_ssi_delbuddies(odata->sess, odata->conn, group, sns, tmp); | |
2677 free(sns); | 2731 free(sns); |
2678 } | 2732 } |
2679 } | 2733 } |
2680 } | 2734 } |
2681 | |
2682 /* while (buddies) { | |
2683 if (n > MSG_LEN - 18) { | |
2684 aim_bos_setbuddylist(odata->sess, odata->conn, buf); | |
2685 n = 0; | |
2686 } | |
2687 n += g_snprintf(buf + n, sizeof(buf) - n, "%s&", (char *)buddies->data); | |
2688 buddies = buddies->next; | |
2689 } | |
2690 aim_bos_setbuddylist(odata->sess, odata->conn, buf); */ | |
2691 } | |
2692 | |
2693 static void oscar_remove_buddy(struct gaim_connection *g, char *name, char *group) { | |
2694 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | |
2695 if (odata->sess->ssi.received_data) | |
2696 while (aim_ssi_inlist(odata->sess, odata->conn, name, 0x0000) && !aim_ssi_delbuddies(odata->sess, odata->conn, group, &name, 1)) | |
2697 debug_printf("ssi: deleted %s from the server list\n", name); | |
2698 /* aim_remove_buddy(odata->sess, odata->conn, name); */ | |
2699 } | |
2700 | |
2701 static void oscar_remove_buddies(struct gaim_connection *g, GList *buddies, char *group) { | |
2702 GList *cur; | |
2703 struct oscar_data *odata = (struct oscar_data *)g->proto_data; | |
2704 if (odata->sess->ssi.received_data) { | |
2705 int tmp = 0; | |
2706 for (cur=buddies; cur; cur=cur->next) | |
2707 if (aim_ssi_inlist(odata->sess, odata->conn, cur->data, 0x0000)) | |
2708 tmp++; | |
2709 if (tmp) { | |
2710 char **sns; | |
2711 sns = (char **)malloc(tmp*sizeof(char*)); | |
2712 tmp = 0; | |
2713 for (cur=buddies; cur; cur=cur->next) | |
2714 if (aim_ssi_inlist(odata->sess, odata->conn, cur->data, 0x0000)) { | |
2715 sns[tmp] = cur->data; | |
2716 tmp++; | |
2717 } | |
2718 aim_ssi_delbuddies(odata->sess, odata->conn, group, sns, tmp); | |
2719 debug_printf("ssi: deleted some buddies from the server list\n"); | |
2720 free(sns); | |
2721 } | |
2722 } | |
2723 /* for (cur=buddies; cur; cur=cur->next) | |
2724 aim_remove_buddy(odata->sess, odata->conn, cur->data); */ | |
2725 } | 2735 } |
2726 | 2736 |
2727 static int gaim_ssi_parserights(aim_session_t *sess, aim_frame_t *fr, ...) { | 2737 static int gaim_ssi_parserights(aim_session_t *sess, aim_frame_t *fr, ...) { |
2728 /* XXX - Fix parsing of the ssi rights packet and pass us the data | 2738 /* XXX - Fix parsing of the ssi rights packet and pass us the data |
2729 fu16_t maxbuddies, maxgroups, maxpermits, maxdenies; | 2739 fu16_t maxbuddies, maxgroups, maxpermits, maxdenies; |
2745 return 1; | 2755 return 1; |
2746 } | 2756 } |
2747 | 2757 |
2748 static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) { | 2758 static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) { |
2749 struct gaim_connection *gc = sess->aux_data; | 2759 struct gaim_connection *gc = sess->aux_data; |
2750 struct aim_ssi_item *curitem, *curgroup; | 2760 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; |
2761 struct aim_ssi_item *curitem; | |
2751 struct group *g; | 2762 struct group *g; |
2752 GSList *grp; | |
2753 GSList *mem; | 2763 GSList *mem; |
2754 int tmp; | 2764 int tmp; |
2755 char **sns; | 2765 char **sns; |
2756 | 2766 |
2757 debug_printf("ssi: syncing local list and server list\n"); | 2767 debug_printf("ssi: syncing local list and server list\n"); |
2758 | 2768 |
2769 /* Delete the buddy list */ | |
2770 if (odata->icq) { | |
2771 aim_ssi_deletelist(sess, fr->conn); | |
2772 return; | |
2773 } | |
2774 | |
2759 /* Activate SSI */ | 2775 /* Activate SSI */ |
2760 debug_printf("ssi: activating server-stored buddy list\n"); | 2776 debug_printf("ssi: activating server-stored buddy list\n"); |
2761 aim_ssi_enable(sess, fr->conn); | 2777 aim_ssi_enable(sess, fr->conn); |
2762 | 2778 |
2763 /* Clean the buddy list */ | 2779 /* Clean the buddy list */ |
2764 /* aim_ssi_cleanlist(sess, fr->conn); */ | 2780 /* aim_ssi_cleanlist(sess, fr->conn); */ |
2765 | |
2766 /* Delete the buddy list */ | |
2767 /* aim_ssi_deletelist(sess, fr->conn); */ | |
2768 | 2781 |
2769 /* Add from server list to local list */ | 2782 /* Add from server list to local list */ |
2770 tmp = 0; | 2783 tmp = 0; |
2771 for (curitem=sess->ssi.items; curitem; curitem=curitem->next) { | 2784 for (curitem=sess->ssi.items; curitem; curitem=curitem->next) { |
2772 switch (curitem->type) { | 2785 switch (curitem->type) { |
2773 case 0x0000: /* Buddy */ | 2786 case 0x0000: /* Buddy */ |
2774 if ((curitem->name) && (!find_buddy(gc, curitem->name))) { | 2787 if ((curitem->name) && (!find_buddy(gc, curitem->name))) { |
2775 curgroup = sess->ssi.items; | 2788 struct aim_ssi_item *curgroup = sess->ssi.items; |
2776 while (curgroup) { | 2789 while (curgroup) { |
2777 if ((curgroup->type == 0x0001) && (curgroup->gid == curitem->gid) && (curgroup->name)) { | 2790 if ((curgroup->type == 0x0001) && (curgroup->gid == curitem->gid) && (curgroup->name)) { |
2778 debug_printf("ssi: adding buddy %s from server list to local list\n", curitem->name); | 2791 debug_printf("ssi: adding buddy %s to group %s to local list\n", curitem->name, curgroup->name); |
2779 add_buddy(gc, curgroup->name, curitem->name, 0); | 2792 add_buddy(gc, curgroup->name, curitem->name, 0); |
2780 tmp++; | 2793 tmp++; |
2781 } | 2794 } |
2782 curgroup = curgroup->next; | 2795 curgroup = curgroup->next; |
2783 } | 2796 } |
2784 } | 2797 } |
2785 break; | 2798 break; |
2786 | 2799 |
2787 case 0x0002: /* Permit item */ | 2800 case 0x0002: /* Permit buddy */ |
2788 if (curitem->name) { | 2801 if (curitem->name) { |
2789 GSList *list; | 2802 GSList *list; |
2790 for (list=gc->permit; (list && aim_sncmp(curitem->name, list->data)); list=list->next); | 2803 for (list=gc->permit; (list && aim_sncmp(curitem->name, list->data)); list=list->next); |
2791 if (!list) { | 2804 if (!list) { |
2792 char *name; | 2805 char *name; |
2793 debug_printf("ssi: adding permit %s from server list to local list\n", curitem->name); | 2806 debug_printf("ssi: adding permit buddy %s to local list\n", curitem->name); |
2794 name = g_strdup(normalize(curitem->name)); | 2807 name = g_strdup(normalize(curitem->name)); |
2795 gc->permit = g_slist_append(gc->permit, name); | 2808 gc->permit = g_slist_append(gc->permit, name); |
2796 build_allow_list(); | 2809 build_allow_list(); |
2797 tmp++; | 2810 tmp++; |
2798 } | 2811 } |
2799 } | 2812 } |
2800 break; | 2813 break; |
2801 | 2814 |
2802 case 0x0003: /* Deny item */ | 2815 case 0x0003: /* Deny buddy */ |
2803 if (curitem->name) { | 2816 if (curitem->name) { |
2804 GSList *list; | 2817 GSList *list; |
2805 for (list=gc->deny; (list && aim_sncmp(curitem->name, list->data)); list=list->next); | 2818 for (list=gc->deny; (list && aim_sncmp(curitem->name, list->data)); list=list->next); |
2806 if (!list) { | 2819 if (!list) { |
2807 char *name; | 2820 char *name; |
2808 debug_printf("ssi: adding deny %s from server list to local list\n", curitem->name); | 2821 debug_printf("ssi: adding deny buddy %s to local list\n", curitem->name); |
2809 name = g_strdup(normalize(curitem->name)); | 2822 name = g_strdup(normalize(curitem->name)); |
2810 gc->deny = g_slist_append(gc->deny, name); | 2823 gc->deny = g_slist_append(gc->deny, name); |
2811 build_block_list(); | 2824 build_block_list(); |
2812 tmp++; | 2825 tmp++; |
2813 } | 2826 } |
2814 } | 2827 } |
2815 break; | 2828 break; |
2816 | 2829 |
2817 case 0x0004: /* Permit/deny item */ | 2830 case 0x0004: /* Permit/deny setting */ |
2818 if (curitem->data) { | 2831 if (curitem->data) { |
2819 fu8_t permdeny; | 2832 fu8_t permdeny; |
2820 if (permdeny = aim_ssi_getpermdeny(curitem->data)) { | 2833 if ((permdeny = aim_ssi_getpermdeny(curitem->data)) && (permdeny != gc->permdeny)) { |
2821 debug_printf("ssi: changing permdeny from %d to %d\n", gc->permdeny, permdeny); | 2834 debug_printf("ssi: changing permdeny from %d to %d\n", gc->permdeny, permdeny); |
2822 gc->permdeny = permdeny; | 2835 gc->permdeny = permdeny; |
2836 tmp++; | |
2823 } | 2837 } |
2824 } | 2838 } |
2825 break; | 2839 break; |
2826 } /* End of switch on curitem->type */ | 2840 } /* End of switch on curitem->type */ |
2827 } /* End of for loop */ | 2841 } /* End of for loop */ |
2829 do_export(gc); | 2843 do_export(gc); |
2830 | 2844 |
2831 /* Add from local list to server list */ | 2845 /* Add from local list to server list */ |
2832 if (gc) { | 2846 if (gc) { |
2833 /* Buddies */ | 2847 /* Buddies */ |
2834 grp = gc->groups; | 2848 GSList *curgrp = gc->groups; |
2835 while (grp) { | 2849 while (curgrp) { |
2836 g = (struct group*)grp->data; | |
2837 tmp = 0; | 2850 tmp = 0; |
2838 for (mem=g->members; mem; mem=mem->next) | 2851 for (mem=((struct group*)curgrp->data)->members; mem; mem=mem->next) |
2839 if (!aim_ssi_inlist(sess, fr->conn, ((struct buddy*)mem->data)->name, 0x0000)) | 2852 if (!aim_ssi_inlist(sess, fr->conn, ((struct buddy*)mem->data)->name, 0x0000)) |
2840 tmp++; | 2853 tmp++; |
2841 sns = (char **)malloc(tmp*sizeof(char*)); | 2854 sns = (char **)malloc(tmp*sizeof(char*)); |
2842 tmp = 0; | 2855 tmp = 0; |
2843 for (mem=g->members; mem; mem=mem->next) | 2856 for (mem=((struct group*)curgrp->data)->members; mem; mem=mem->next) |
2844 if (!aim_ssi_inlist(sess, fr->conn, ((struct buddy*)mem->data)->name, 0x0000)) { | 2857 if (!aim_ssi_inlist(sess, fr->conn, ((struct buddy*)mem->data)->name, 0x0000)) { |
2845 debug_printf("ssi: adding buddy %s from local list to server list\n", ((struct buddy*)mem->data)->name); | 2858 debug_printf("ssi: adding buddy %s from local list to server list\n", ((struct buddy*)mem->data)->name); |
2846 sns[tmp] = ((char *)((struct buddy*)mem->data)->name); | 2859 sns[tmp] = ((char *)((struct buddy*)mem->data)->name); |
2847 tmp++; | 2860 tmp++; |
2848 } | 2861 } |
2849 if (tmp) { | 2862 if (tmp) { |
2850 aim_ssi_addbuddies(sess, fr->conn, g->name, sns, tmp); | 2863 aim_ssi_addbuddies(sess, fr->conn, ((struct group*)curgrp)->name, sns, tmp); |
2851 free(sns); | 2864 free(sns); |
2852 } | 2865 } |
2853 grp = g_slist_next(grp); | 2866 curgrp = g_slist_next(curgrp); |
2854 } | 2867 } |
2855 | 2868 |
2856 /* Permit list */ | 2869 /* Permit list */ |
2857 if (gc->permit) { | 2870 if (gc->permit) { |
2858 GSList *list; | 2871 GSList *list; |
3303 return m; | 3316 return m; |
3304 } | 3317 } |
3305 | 3318 |
3306 static void oscar_set_permit_deny(struct gaim_connection *gc) { | 3319 static void oscar_set_permit_deny(struct gaim_connection *gc) { |
3307 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 3320 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
3308 /* GSList *list; | 3321 if (od->icq) { |
3309 char buf[MAXMSGLEN]; | 3322 GSList *list; |
3310 int at; */ | 3323 char buf[MAXMSGLEN]; |
3311 | 3324 int at; |
3312 if (od->sess->ssi.received_data) | 3325 |
3313 aim_ssi_setpermdeny(od->sess, od->conn, gc->permdeny); | 3326 switch(gc->permdeny) { |
3314 | 3327 case 1: |
3315 /* switch(gc->permdeny) { | 3328 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gc->username); |
3316 case 1: | 3329 break; |
3317 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gc->username); | 3330 case 2: |
3318 break; | 3331 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, gc->username); |
3319 case 2: | 3332 break; |
3320 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, gc->username); | 3333 case 3: |
3321 break; | 3334 list = gc->permit; |
3322 case 3: | 3335 at = 0; |
3323 list = gc->permit; | 3336 while (list) { |
3324 at = 0; | 3337 at += g_snprintf(buf + at, sizeof(buf) - at, "%s&", (char *)list->data); |
3325 while (list) { | 3338 list = list->next; |
3326 at += g_snprintf(buf + at, sizeof(buf) - at, "%s&", (char *)list->data); | 3339 } |
3327 list = list->next; | 3340 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, buf); |
3341 break; | |
3342 case 4: | |
3343 list = gc->deny; | |
3344 at = 0; | |
3345 while (list) { | |
3346 at += g_snprintf(buf + at, sizeof(buf) - at, "%s&", (char *)list->data); | |
3347 list = list->next; | |
3348 } | |
3349 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, buf); | |
3350 break; | |
3351 default: | |
3352 break; | |
3328 } | 3353 } |
3329 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, buf); | 3354 signoff_blocked(gc); |
3330 break; | 3355 } else { |
3331 case 4: | 3356 if (od->sess->ssi.received_data) |
3332 list = gc->deny; | 3357 aim_ssi_setpermdeny(od->sess, od->conn, gc->permdeny); |
3333 at = 0; | 3358 } |
3334 while (list) { | |
3335 at += g_snprintf(buf + at, sizeof(buf) - at, "%s&", (char *)list->data); | |
3336 list = list->next; | |
3337 } | |
3338 aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, buf); | |
3339 break; | |
3340 default: | |
3341 break; | |
3342 } | |
3343 signoff_blocked(gc); */ | |
3344 } | 3359 } |
3345 | 3360 |
3346 static void oscar_add_permit(struct gaim_connection *gc, char *who) { | 3361 static void oscar_add_permit(struct gaim_connection *gc, char *who) { |
3347 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 3362 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
3348 debug_printf("ssi: About to add a permit\n"); | 3363 if (od->icq) { |
3349 if (od->sess->ssi.received_data) | 3364 if (gc->permdeny != 3) return; |
3350 aim_ssi_addpermits(od->sess, od->conn, &who, 1); | 3365 oscar_set_permit_deny(gc); |
3351 /* if (gc->permdeny != 3) return; | 3366 } else { |
3352 oscar_set_permit_deny(gc); */ | 3367 debug_printf("ssi: About to add a permit\n"); |
3368 if (od->sess->ssi.received_data) | |
3369 aim_ssi_addpermits(od->sess, od->conn, &who, 1); | |
3370 } | |
3353 } | 3371 } |
3354 | 3372 |
3355 static void oscar_add_deny(struct gaim_connection *gc, char *who) { | 3373 static void oscar_add_deny(struct gaim_connection *gc, char *who) { |
3356 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 3374 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
3357 debug_printf("ssi: About to add a deny\n"); | 3375 if (od->icq) { |
3358 if (od->sess->ssi.received_data) | 3376 if (gc->permdeny != 4) return; |
3359 aim_ssi_adddenies(od->sess, od->conn, &who, 1); | 3377 oscar_set_permit_deny(gc); |
3360 /* if (gc->permdeny != 4) return; | 3378 } else { |
3361 oscar_set_permit_deny(gc); */ | 3379 debug_printf("ssi: About to add a deny\n"); |
3380 if (od->sess->ssi.received_data) | |
3381 aim_ssi_adddenies(od->sess, od->conn, &who, 1); | |
3382 } | |
3362 } | 3383 } |
3363 | 3384 |
3364 static void oscar_rem_permit(struct gaim_connection *gc, char *who) { | 3385 static void oscar_rem_permit(struct gaim_connection *gc, char *who) { |
3365 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 3386 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
3366 debug_printf("ssi: About to delete a permit\n"); | 3387 if (od->icq) { |
3367 if (od->sess->ssi.received_data) | 3388 if (gc->permdeny != 3) return; |
3368 aim_ssi_delpermits(od->sess, od->conn, &who, 1); | 3389 oscar_set_permit_deny(gc); |
3369 /* if (gc->permdeny != 3) return; | 3390 } else { |
3370 oscar_set_permit_deny(gc); */ | 3391 debug_printf("ssi: About to delete a permit\n"); |
3392 if (od->sess->ssi.received_data) | |
3393 aim_ssi_delpermits(od->sess, od->conn, &who, 1); | |
3394 } | |
3371 } | 3395 } |
3372 | 3396 |
3373 static void oscar_rem_deny(struct gaim_connection *gc, char *who) { | 3397 static void oscar_rem_deny(struct gaim_connection *gc, char *who) { |
3374 struct oscar_data *od = (struct oscar_data *)gc->proto_data; | 3398 struct oscar_data *od = (struct oscar_data *)gc->proto_data; |
3375 debug_printf("ssi: About to delete a deny\n"); | 3399 if (od->icq) { |
3376 if (od->sess->ssi.received_data) | 3400 if (gc->permdeny != 4) return; |
3377 aim_ssi_deldenies(od->sess, od->conn, &who, 1); | 3401 oscar_set_permit_deny(gc); |
3378 /* if (gc->permdeny != 4) return; | 3402 } else { |
3379 oscar_set_permit_deny(gc); */ | 3403 debug_printf("ssi: About to delete a deny\n"); |
3404 if (od->sess->ssi.received_data) | |
3405 aim_ssi_deldenies(od->sess, od->conn, &who, 1); | |
3406 } | |
3380 } | 3407 } |
3381 | 3408 |
3382 static GList *oscar_away_states(struct gaim_connection *gc) | 3409 static GList *oscar_away_states(struct gaim_connection *gc) |
3383 { | 3410 { |
3384 struct oscar_data *od = gc->proto_data; | 3411 struct oscar_data *od = gc->proto_data; |