comparison src/protocols/zephyr/zephyr.c @ 9741:b10d4c6ac7eb

[gaim-migrate @ 10606] (20:26:58) KingAnt: LSchiere: Can you revert it and I'll post some suggestions to the patch in the tracker? committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 12 Aug 2004 00:26:28 +0000
parents 2bb5e2cd64bd
children 4a8bf81b82ae
comparison
equal deleted inserted replaced
9740:2bb5e2cd64bd 9741:b10d4c6ac7eb
30 #include "notify.h" 30 #include "notify.h"
31 #include "prpl.h" 31 #include "prpl.h"
32 #include "server.h" 32 #include "server.h"
33 #include "util.h" 33 #include "util.h"
34 #include "cmds.h" 34 #include "cmds.h"
35 #include "privacy.h"
36 35
37 #include "zephyr/zephyr.h" 36 #include "zephyr/zephyr.h"
38 #include "internal.h" 37 #include "internal.h"
39 38
40 #include <strings.h> 39 #include <strings.h>
690 flags |= GAIM_CONV_IM_AUTO_RESP; 689 flags |= GAIM_CONV_IM_AUTO_RESP;
691 stripped_sender = zephyr_strip_foreign_realm(notice.z_sender); 690 stripped_sender = zephyr_strip_foreign_realm(notice.z_sender);
692 691
693 if (!g_ascii_strcasecmp(notice.z_opcode,"PING")) 692 if (!g_ascii_strcasecmp(notice.z_opcode,"PING"))
694 serv_got_typing(gc,stripped_sender,ZEPHYR_TYPING_RECV_TIMEOUT, GAIM_TYPING); 693 serv_got_typing(gc,stripped_sender,ZEPHYR_TYPING_RECV_TIMEOUT, GAIM_TYPING);
695 else { 694 else
696 GSList* l; 695 serv_got_im(gc, stripped_sender, buf3, flags, time(NULL));
697 gboolean in_deny; 696
698
699 switch (gc->account->perm_deny) {
700 case GAIM_PRIVACY_ALLOW_ALL:
701 in_deny = 0; break;
702 case GAIM_PRIVACY_DENY_ALL:
703 in_deny = 1; break;
704 case GAIM_PRIVACY_ALLOW_USERS: /* See if stripped_sender is in gc->account->permit and allow appropriately */
705 in_deny = 1;
706 for(l=gc->account->permit;l!=NULL;l=l->next) {
707 if (!gaim_utf8_strcasecmp(stripped_sender, gaim_normalize(gc->account, (char *)l->data))) {
708 fprintf(stderr,"stripped sender %s l->data %sf\n",stripped_sender, (char *)l->data);
709 in_deny=0;
710 break;
711 }
712 }
713 break;
714 case GAIM_PRIVACY_DENY_USERS: /* See if stripped_sender is in gc->account->deny and deny if so */
715 in_deny = 0;
716 for(l=gc->account->deny;l!=NULL;l=l->next) {
717 if (!gaim_utf8_strcasecmp(stripped_sender, gaim_normalize(gc->account, (char *)l->data))) {
718 fprintf(stderr,"stripped sender %s l->data %sf\n",stripped_sender, (char *)l->data);
719 in_deny=1;
720 break;
721 }
722 }
723 break;
724 case GAIM_PRIVACY_ALLOW_BUDDYLIST:
725 in_deny = 1;
726 if (gaim_find_buddy(gc->account,stripped_sender)!=NULL) {
727 in_deny = 0;
728 }
729 break;
730 default:
731 in_deny=0; break;
732 }
733
734 if (!in_deny) {
735 serv_got_im(gc, stripped_sender, buf3, flags, time(NULL));
736 }
737 }
738 g_free(stripped_sender); 697 g_free(stripped_sender);
739
740 } else { 698 } else {
741 zephyr_triple *zt1, *zt2; 699 zephyr_triple *zt1, *zt2;
742 gchar *send_inst_utf8; 700 gchar *send_inst_utf8;
743 zephyr_account *zephyr = gc->proto_data; 701 zephyr_account *zephyr = gc->proto_data;
744 zt1 = new_triple(gc->proto_data,notice.z_class, notice.z_class_inst, notice.z_recipient); 702 zt1 = new_triple(gc->proto_data,notice.z_class, notice.z_class_inst, notice.z_recipient);
1771 zephyr_gaim_cmd_zc, _("zc &lt;class&gt;: Send a message to &lt;<i>class</i>,PERSONAL,*&gt;"), NULL); 1729 zephyr_gaim_cmd_zc, _("zc &lt;class&gt;: Send a message to &lt;<i>class</i>,PERSONAL,*&gt;"), NULL);
1772 1730
1773 } 1731 }
1774 1732
1775 1733
1776 static void
1777 zephyr_add_deny(GaimConnection *gc, const char *who)
1778 {
1779 gaim_privacy_deny_add(gc->account,who,1);
1780 }
1781
1782 static void
1783 zephyr_remove_deny(GaimConnection *gc, const char *who)
1784 {
1785 gaim_privacy_deny_remove(gc->account,who,1);
1786 }
1787
1788 static void
1789 zephyr_add_permit(GaimConnection *gc, const char *who)
1790 {
1791 gaim_privacy_permit_add(gc->account,who,1);
1792 }
1793
1794 static void
1795 zephyr_remove_permit(GaimConnection *gc, const char *who)
1796 {
1797 gaim_privacy_permit_remove(gc->account,who,1);
1798 }
1799
1800 static void
1801 zephyr_set_permit_deny(GaimConnection *gc)
1802 {
1803 /* This doesn't have to do anything, since really, we can just check account->perm_deny when deciding whether to di */
1804 return;
1805 }
1806 static int zephyr_resubscribe(GaimConnection *gc) 1734 static int zephyr_resubscribe(GaimConnection *gc)
1807 { 1735 {
1808 /* Resubscribe to the in-memory list of subscriptions and also 1736 /* Resubscribe to the in-memory list of subscriptions and also
1809 unsubscriptions*/ 1737 unsubscriptions*/
1810 zephyr_account *zephyr = gc->proto_data; 1738 zephyr_account *zephyr = gc->proto_data;
1909 NULL, /* change password */ 1837 NULL, /* change password */
1910 NULL, /* add_buddy */ 1838 NULL, /* add_buddy */
1911 NULL, /* add_buddies */ 1839 NULL, /* add_buddies */
1912 NULL, /* remove_buddy */ 1840 NULL, /* remove_buddy */
1913 NULL, /* remove_buddies */ 1841 NULL, /* remove_buddies */
1914 zephyr_add_permit, /* add_permit -- not useful, since anyone can zephyr you by default*/ 1842 NULL, /* add_permit -- not useful, since anyone can zephyr you by default*/
1915 zephyr_add_deny, /* XXX add_deny -- maybe put an auto "I'm ignoring your zephyrs*/ 1843 NULL, /* XXX add deny -- maybe put an auto "I'm ignoring your zephyrs*/
1916 zephyr_remove_permit, /* remove_permit -- not useful, see add permit */ 1844 NULL, /* remove_permit -- not useful, see add permit */
1917 zephyr_remove_deny, /* XXX remove deny -- remove above deny, */ 1845 NULL, /* XXX remove deny -- remove above deny, */
1918 zephyr_set_permit_deny, /* ??? set permit deny */ 1846 NULL, /* ??? set permit deny */
1919 NULL, /* --- warn */ 1847 NULL, /* --- warn */
1920 zephyr_join_chat, /* join_chat */ 1848 zephyr_join_chat, /* join_chat */
1921 NULL, /* reject_chat */ 1849 NULL, /* reject_chat */
1922 NULL, /* chat_invite */ 1850 NULL, /* chat_invite */
1923 zephyr_chat_leave, /* chat_leave */ 1851 zephyr_chat_leave, /* chat_leave */