diff 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
line wrap: on
line diff
--- a/src/privacy.c	Sun Jul 17 21:38:59 2005 +0000
+++ b/src/privacy.c	Sun Jul 17 23:36:34 2005 +0000
@@ -170,6 +170,40 @@
 	return TRUE;
 }
 
+gboolean
+gaim_privacy_check(GaimAccount *account, const char *who)
+{
+	GSList *list;
+
+	switch (account->perm_deny) {
+		case GAIM_PRIVACY_ALLOW_ALL:
+			return TRUE;
+
+		case GAIM_PRIVACY_DENY_ALL:
+			return FALSE;
+
+		case GAIM_PRIVACY_ALLOW_USERS:
+			for (list=account->permit; list!=NULL; list=list->next) {
+				if (!gaim_utf8_strcasecmp(who, gaim_normalize(account, (char *)list->data)))
+					return TRUE;
+			}
+			return FALSE;
+
+		case GAIM_PRIVACY_DENY_USERS:
+			for (list=account->deny; list!=NULL; list=list->next) {
+				if (!gaim_utf8_strcasecmp(who, gaim_normalize( account, (char *)list->data )))
+					return FALSE;
+			}
+			return TRUE;
+
+		case GAIM_PRIVACY_ALLOW_BUDDYLIST:
+			return (gaim_find_buddy(account, who) != NULL);
+
+		default:
+			g_return_val_if_reached(TRUE);
+	}
+}
+
 void
 gaim_privacy_set_ui_ops(GaimPrivacyUiOps *ops)
 {