libpurple/privacy.h

Fri, 09 Feb 2007 07:42:01 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Fri, 09 Feb 2007 07:42:01 +0000
changeset 15657
a9e38c097d28
parent 15435
4b933b06d75e
child 15884
4de1981757fc
permissions
-rw-r--r--

sf patch #1655057, from Peter Tang

Fix a memory leak when signing off an account, I think. Peter Tang
found it and suggested one fix. I suggested another, then Sadrul
made it work. I like this change. We're now re-using GaimStatusType
objects instead of making lots of copies of them.

6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
1 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
2 * @file privacy.h Privacy API
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
3 * @ingroup core
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
4 *
4687
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
5 * gaim
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
6 *
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7035
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7035
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7035
diff changeset
9 * source distribution.
8307
8663aff7b973 [gaim-migrate @ 9031]
Christian Hammond <chipx86@chipx86.com>
parents: 8175
diff changeset
10 *
4687
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
15 *
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
20 *
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
24 */
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
25 #ifndef _GAIM_PRIVACY_H_
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
26 #define _GAIM_PRIVACY_H_
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
27
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
28 #include "account.h"
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
29
8175
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
30 /**
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
31 * Privacy data types.
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
32 */
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
33 typedef enum _GaimPrivacyType
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
34 {
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
35 GAIM_PRIVACY_ALLOW_ALL = 1,
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
36 GAIM_PRIVACY_DENY_ALL,
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
37 GAIM_PRIVACY_ALLOW_USERS,
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
38 GAIM_PRIVACY_DENY_USERS,
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
39 GAIM_PRIVACY_ALLOW_BUDDYLIST
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
40 } GaimPrivacyType;
4e79974d452c [gaim-migrate @ 8889]
Mark Doliner <markdoliner@pidgin.im>
parents: 8046
diff changeset
41
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
42 #ifdef __cplusplus
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
43 extern "C" {
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
44 #endif
4687
91ad36873636 [gaim-migrate @ 4998]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
45
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
46 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
47 * Privacy core/UI operations.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
48 */
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
49 typedef struct
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
50 {
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
51 void (*permit_added)(GaimAccount *account, const char *name);
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
52 void (*permit_removed)(GaimAccount *account, const char *name);
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
53 void (*deny_added)(GaimAccount *account, const char *name);
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
54 void (*deny_removed)(GaimAccount *account, const char *name);
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
55
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
56 } GaimPrivacyUiOps;
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
57
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
58 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
59 * Adds a user to the account's permit list.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
60 *
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
61 * @param account The account.
6720
cdc5348dd848 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6379
diff changeset
62 * @param name The name of the user to add to the list.
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
63 * @param local_only If TRUE, only the local list is updated, and not
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
64 * the server.
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
65 *
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
66 * @return TRUE if the user was added successfully, or @c FALSE otherwise.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
67 */
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
68 gboolean gaim_privacy_permit_add(GaimAccount *account, const char *name,
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
69 gboolean local_only);
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
70
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
71 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
72 * Removes a user from the account's permit list.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
73 *
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
74 * @param account The account.
6720
cdc5348dd848 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6379
diff changeset
75 * @param name The name of the user to add to the list.
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
76 * @param local_only If TRUE, only the local list is updated, and not
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
77 * the server.
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
78 *
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
79 * @return TRUE if the user was removed successfully, or @c FALSE otherwise.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
80 */
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
81 gboolean gaim_privacy_permit_remove(GaimAccount *account, const char *name,
6379
60e805354d1e [gaim-migrate @ 6884]
Christian Hammond <chipx86@chipx86.com>
parents: 6378
diff changeset
82 gboolean local_only);
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
83
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
84 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
85 * Adds a user to the account's deny list.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
86 *
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
87 * @param account The account.
6720
cdc5348dd848 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6379
diff changeset
88 * @param name The name of the user to add to the list.
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
89 * @param local_only If TRUE, only the local list is updated, and not
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
90 * the server.
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
91 *
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
92 * @return TRUE if the user was added successfully, or @c FALSE otherwise.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
93 */
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
94 gboolean gaim_privacy_deny_add(GaimAccount *account, const char *name,
6379
60e805354d1e [gaim-migrate @ 6884]
Christian Hammond <chipx86@chipx86.com>
parents: 6378
diff changeset
95 gboolean local_only);
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
96
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
97 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
98 * Removes a user from the account's deny list.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
99 *
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
100 * @param account The account.
6720
cdc5348dd848 [gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents: 6379
diff changeset
101 * @param name The name of the user to add to the list.
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
102 * @param local_only If TRUE, only the local list is updated, and not
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
103 * the server.
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
104 *
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
105 * @return TRUE if the user was removed successfully, or @c FALSE otherwise.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
106 */
6378
233d1294508f [gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
107 gboolean gaim_privacy_deny_remove(GaimAccount *account, const char *name,
6379
60e805354d1e [gaim-migrate @ 6884]
Christian Hammond <chipx86@chipx86.com>
parents: 6378
diff changeset
108 gboolean local_only);
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
109
15380
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
110 /**
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
111 * Allow a user to send messages. If current privacy setting for the account is:
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
112 * GAIM_PRIVACY_ALLOW_USERS: The user is added to the allow-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
113 * GAIM_PRIVACY_DENY_USERS : The user is removed from the deny-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
114 * GAIM_PRIVACY_ALLOW_ALL : No changes made.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
115 * GAIM_PRIVACY_DENY_ALL : The privacy setting is changed to
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
116 * GAIM_PRIVACY_ALLOW_USERS and the user
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
117 * is added to the allow-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
118 * GAIM_PRIVACY_ALLOW_BUDDYLIST: No changes made if the user is already in
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
119 * the buddy-list. Otherwise the setting is
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
120 * changed to GAIM_PRIVACY_ALLOW_USERS, all the
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
121 * buddies are added to the allow-list, and the
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
122 * user is also added to the allow-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
123 *
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
124 * @param account The account.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
125 * @param who The name of the user.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
126 * @param local Whether the change is local-only.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
127 * @param restore Should the previous allow/deny list be restored if the
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
128 * privacy setting is changed.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
129 */
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
130 void gaim_privacy_allow(GaimAccount *account, const char *who, gboolean local,
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
131 gboolean restore);
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
132
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
133 /**
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
134 * Block messages from a user. If current privacy setting for the account is:
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
135 * GAIM_PRIVACY_ALLOW_USERS: The user is removed from the allow-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
136 * GAIM_PRIVACY_DENY_USERS : The user is added to the deny-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
137 * GAIM_PRIVACY_DENY_ALL : No changes made.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
138 * GAIM_PRIVACY_ALLOW_ALL : The privacy setting is changed to
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
139 * GAIM_PRIVACY_DENY_USERS and the user is
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
140 * added to the deny-list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
141 * GAIM_PRIVACY_ALLOW_BUDDYLIST: If the user is not in the buddy-list,
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
142 * then no changes made. Otherwise, the setting
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
143 * is changed to GAIM_PRIVACY_ALLOW_USERS, all
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
144 * the buddies are added to the allow-list, and
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
145 * this user is removed from the list.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
146 *
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
147 * @param account The account.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
148 * @param who The name of the user.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
149 * @param local Whether the change is local-only.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
150 * @param restore Should the previous allow/deny list be restored if the
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
151 * privacy setting is changed.
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
152 */
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
153 void gaim_privacy_deny(GaimAccount *account, const char *who, gboolean local,
1171796358b3 [gaim-migrate @ 18109]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14254
diff changeset
154 gboolean restore);
11111
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
155
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
156 /**
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
157 * Check the privacy-setting for a user.
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
158 *
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
159 * @param account The account.
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
160 * @param who The name of the user.
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
161 *
11122
28eadeadf52a [gaim-migrate @ 13178]
Richard Laager <rlaager@pidgin.im>
parents: 11111
diff changeset
162 * @return @c FALSE if the specified account's privacy settings block the user or @c TRUE otherwise. The meaning of "block" is protocol-dependent and generally relates to status and/or sending of messages.
11111
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
163 */
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
164 gboolean gaim_privacy_check(GaimAccount *account, const char *who);
4621d9b973a4 [gaim-migrate @ 13163]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 8307
diff changeset
165
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
166 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
167 * Sets the UI operations structure for the privacy subsystem.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
168 *
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
169 * @param ops The UI operations structure.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
170 */
7035
76bca80cd91d [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
171 void gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops);
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
172
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
173 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
174 * Returns the UI operations structure for the privacy subsystem.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
175 *
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
176 * @return The UI operations structure.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
177 */
7035
76bca80cd91d [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6720
diff changeset
178 GaimPrivacyUiOps *gaim_privacy_get_ui_ops(void);
6371
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
179
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
180 /**
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
181 * Initializes the privacy subsystem.
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
182 */
e92b66ee5518 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
183 void gaim_privacy_init(void);
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
184
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
185 #ifdef __cplusplus
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
186 }
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
187 #endif
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
188
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
189 #endif /* _GAIM_PRIVACY_H_ */

mercurial