diff src/protocols/yahoo/yahoochat.c @ 10937:ca3e0882d377

[gaim-migrate @ 12721] sf patch #1202156, from Bleeter Yaluser . Forward port privacy . Tidy up whitespace . Remove file TX send limit committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 24 May 2005 04:54:27 +0000
parents 7d13c04387ad
children ec90b7d126be
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoochat.c	Tue May 24 04:46:51 2005 +0000
+++ b/src/protocols/yahoo/yahoochat.c	Tue May 24 04:54:27 2005 +0000
@@ -31,6 +31,7 @@
 #endif
 
 #include "debug.h"
+#include "privacy.h"
 #include "prpl.h"
 
 #include "conversation.h"
@@ -154,6 +155,11 @@
 	if (members) {
 		g_hash_table_replace(components, g_strdup("members"), g_strdup(members->str));
 	}
+	if (!yahoo_privacy_check(gc, who)) {
+		gaim_debug_info("yahoo",
+		    "Invite to conference %s from %s has been dropped.\n", room, who);
+		return;
+	}
 	serv_got_chat_invite(gc, room, who, msg, components);
 
 	g_string_free(members, TRUE);
@@ -332,10 +338,13 @@
 
 void yahoo_process_chat_join(GaimConnection *gc, struct yahoo_packet *pkt)
 {
+	GaimAccount *account = gaim_connection_get_account(gc);
 	struct yahoo_data *yd = (struct yahoo_data *) gc->proto_data;
 	GaimConversation *c = NULL;
 	GSList *l;
 	GList *members = NULL;
+	GList *roomies = NULL;
+	GaimConversationUiOps *ops;
 	char *room = NULL;
 	char *topic = NULL;
 	char *someid, *someotherid, *somebase64orhashosomething, *somenegativenumber;
@@ -434,6 +443,18 @@
 		yahoo_chat_add_users(GAIM_CONV_CHAT(c), members);
 	}
 
+	ops = gaim_conversation_get_ui_ops(c);
+
+	for (l = account->deny; l != NULL; l = l->next) {
+		for (roomies = members; roomies; roomies = roomies->next) {
+			if (!gaim_utf8_strcasecmp((char *)l->data, roomies->data)) {
+				gaim_debug_info("yahoo", "Ignoring room member %s in room %s\n" ,roomies->data, room);
+				gaim_conv_chat_ignore(GAIM_CONV_CHAT(c),roomies->data);
+				ops->chat_update_user((c), roomies->data);
+			}
+		}
+	}
+	g_list_free(roomies);
 	g_list_free(members);
 	g_free(room);
 	if (topic)
@@ -562,6 +583,11 @@
 
 		components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 		g_hash_table_replace(components, g_strdup("room"), g_strdup(room));
+		if (!yahoo_privacy_check(gc, who)) {
+			gaim_debug_info("yahoo",
+			"Invite to room %s from %s has been dropped.\n", room, who);
+			return;
+		}
 		serv_got_chat_invite(gc, room, who, msg, components);
 	}
 	if (room)