annotate src/privacy.c @ 8146:596c64a2a2d0

[gaim-migrate @ 8854] " (16:36:05) Me: Hi Sean (16:36:21) Me: Mind if I e-mail you a little COPYRIGHT related diff? (16:37:17) Sean: Yes, I do! (16:37:22) Sean: How dare you consider e-mailing me patches? (16:37:26) Sean: seriously, now. (16:37:32) Me: (16:38:42) Me: Look at my webcam: [URL to patch, now attached to this message] (16:43:03) Sean: Have Luke commit it for me (16:43:17) Sean: I won't be around until late tomorrow night. (16:46:53) Me: ahh, k It's a pretty straightforward deal - I think I mentioned this the other day: .[c|h] files in src/ should have the generic copyright. Also, giving Marc Mulcahy credit for the accessibility stuff. Cheers, John [Silvestri]" except that i'd already given Marc credit committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 20 Jan 2004 02:51:14 +0000
parents fa6395637e2c
children 20262ccefdd8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * gaim
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8007
diff changeset
4 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8007
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8007
diff changeset
6 * source distribution.
8007
a13118091bc7 [gaim-migrate @ 8685]
Christian Hammond <chipx86@chipx86.com>
parents: 7581
diff changeset
7 *
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * (at your option) any later version.
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 *
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * GNU General Public License for more details.
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 *
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 */
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 #include "internal.h"
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #include "account.h"
6375
72023626d5b8 [gaim-migrate @ 6880]
Christian Hammond <chipx86@chipx86.com>
parents: 6373
diff changeset
25 #include "debug.h"
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 #include "privacy.h"
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include "server.h"
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "util.h"
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 static GaimPrivacyUiOps *privacy_ops = NULL;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 gboolean
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
33 gaim_privacy_permit_add(GaimAccount *account, const char *who,
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
34 gboolean local_only)
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 GSList *l;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 char *name;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 g_return_val_if_fail(account != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 g_return_val_if_fail(who != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
42 name = g_strdup(gaim_normalize(account, who));
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 for (l = account->permit; l != NULL; l = l->next) {
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
45 if (!gaim_utf8_strcasecmp(name, gaim_normalize(account, (char *)l->data)))
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 break;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 g_free(name);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 if (l != NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 return FALSE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 account->permit = g_slist_append(account->permit, g_strdup(who));
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
56 if (!local_only && gaim_account_is_connected(account))
6373
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
57 serv_add_permit(gaim_account_get_connection(account), who);
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
58
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 gaim_blist_save();
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 if (privacy_ops != NULL && privacy_ops->permit_added != NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 privacy_ops->permit_added(account, who);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 return TRUE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 gboolean
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
68 gaim_privacy_permit_remove(GaimAccount *account, const char *who,
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
69 gboolean local_only)
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 GSList *l;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 char *name;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 g_return_val_if_fail(account != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 g_return_val_if_fail(who != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
77 name = g_strdup(gaim_normalize(account, who));
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 for (l = account->permit; l != NULL; l = l->next) {
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
80 if (!gaim_utf8_strcasecmp(name, gaim_normalize(account, (char *)l->data)))
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 break;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 g_free(name);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 if (l == NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 return FALSE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 account->permit = g_slist_remove(account->permit, l->data);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 g_free(l->data);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
92 if (!local_only && gaim_account_is_connected(account))
7581
48f31501c3c1 [gaim-migrate @ 8199]
Mark Doliner <mark@kingant.net>
parents: 7261
diff changeset
93 serv_rem_permit(gaim_account_get_connection(account), who);
6373
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
94
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 gaim_blist_save();
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 if (privacy_ops != NULL && privacy_ops->permit_removed != NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 privacy_ops->permit_removed(account, who);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 return TRUE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 gboolean
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
104 gaim_privacy_deny_add(GaimAccount *account, const char *who,
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
105 gboolean local_only)
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 GSList *l;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 char *name;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 g_return_val_if_fail(account != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 g_return_val_if_fail(who != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
113 name = g_strdup(gaim_normalize(account, who));
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 for (l = account->deny; l != NULL; l = l->next) {
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
116 if (!gaim_utf8_strcasecmp(name, gaim_normalize(account, (char *)l->data)))
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 break;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 g_free(name);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 if (l != NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 return FALSE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 account->deny = g_slist_append(account->deny, g_strdup(who));
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
127 if (!local_only && gaim_account_is_connected(account))
6373
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
128 serv_add_deny(gaim_account_get_connection(account), who);
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
129
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 gaim_blist_save();
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 if (privacy_ops != NULL && privacy_ops->deny_added != NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 privacy_ops->deny_added(account, who);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 return TRUE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 gboolean
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
139 gaim_privacy_deny_remove(GaimAccount *account, const char *who,
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
140 gboolean local_only)
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 GSList *l;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 char *name;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 g_return_val_if_fail(account != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 g_return_val_if_fail(who != NULL, FALSE);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
148 name = g_strdup(gaim_normalize(account, who));
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 for (l = account->deny; l != NULL; l = l->next) {
7261
1930e3d00ecd [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7107
diff changeset
151 if (!gaim_utf8_strcasecmp(name, gaim_normalize(account, (char *)l->data)))
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 break;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 g_free(name);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 if (l == NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158 return FALSE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 account->deny = g_slist_remove(account->deny, l->data);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161 g_free(l->data);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162
6378
01289157fc37 [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6375
diff changeset
163 if (!local_only && gaim_account_is_connected(account)) {
6375
72023626d5b8 [gaim-migrate @ 6880]
Christian Hammond <chipx86@chipx86.com>
parents: 6373
diff changeset
164 gaim_debug(GAIM_DEBUG_INFO, "privacy",
72023626d5b8 [gaim-migrate @ 6880]
Christian Hammond <chipx86@chipx86.com>
parents: 6373
diff changeset
165 "Removing %s from server-side deny list\n", who);
6373
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
166 serv_rem_deny(gaim_account_get_connection(account), who);
6375
72023626d5b8 [gaim-migrate @ 6880]
Christian Hammond <chipx86@chipx86.com>
parents: 6373
diff changeset
167 }
6373
4d61775a5741 [gaim-migrate @ 6878]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
168
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169 gaim_blist_save();
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 if (privacy_ops != NULL && privacy_ops->deny_removed != NULL)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 privacy_ops->deny_removed(account, who);
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 return TRUE;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177 void
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6378
diff changeset
178 gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops)
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180 privacy_ops = ops;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 GaimPrivacyUiOps *
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6378
diff changeset
184 gaim_privacy_get_ui_ops(void)
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 return privacy_ops;
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187 }
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189 void
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190 gaim_privacy_init(void)
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
191 {
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192 }