comparison src/privacy.c @ 11111:f03dce7ea408

[gaim-migrate @ 13163] Patch #1234440, from sadrul "Mark blocked users in the buddy-list" Patch #1234197, from sadrul "New API fn gaim_privacy_check" Plus changes by me. (Read as: blame me if it's busted, thank sadrul if it works) Basically, all this stuff boils down to the following: We composite a new blocked.png onto the prpl icon in the buddy list if the user is blocked. MSN was the only prpl that used the old blocked.png. However, it looks bad to overlay both icons, so I removed the use of blocked.png from the MSN prpl. As an MSN user, I think the result is intuitive. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sun, 17 Jul 2005 23:36:34 +0000
parents a4ae4fb7f939
children 109ee3bfeac5
comparison
equal deleted inserted replaced
11110:f7ce10cad83d 11111:f03dce7ea408
168 gaim_blist_schedule_save(); 168 gaim_blist_schedule_save();
169 169
170 return TRUE; 170 return TRUE;
171 } 171 }
172 172
173 gboolean
174 gaim_privacy_check(GaimAccount *account, const char *who)
175 {
176 GSList *list;
177
178 switch (account->perm_deny) {
179 case GAIM_PRIVACY_ALLOW_ALL:
180 return TRUE;
181
182 case GAIM_PRIVACY_DENY_ALL:
183 return FALSE;
184
185 case GAIM_PRIVACY_ALLOW_USERS:
186 for (list=account->permit; list!=NULL; list=list->next) {
187 if (!gaim_utf8_strcasecmp(who, gaim_normalize(account, (char *)list->data)))
188 return TRUE;
189 }
190 return FALSE;
191
192 case GAIM_PRIVACY_DENY_USERS:
193 for (list=account->deny; list!=NULL; list=list->next) {
194 if (!gaim_utf8_strcasecmp(who, gaim_normalize( account, (char *)list->data )))
195 return FALSE;
196 }
197 return TRUE;
198
199 case GAIM_PRIVACY_ALLOW_BUDDYLIST:
200 return (gaim_find_buddy(account, who) != NULL);
201
202 default:
203 g_return_val_if_reached(TRUE);
204 }
205 }
206
173 void 207 void
174 gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops) 208 gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops)
175 { 209 {
176 privacy_ops = ops; 210 privacy_ops = ops;
177 } 211 }