changeset 14146:55e3db9db9f6

[gaim-migrate @ 16789] Update gntgf to work for nick-said messages in chats. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 16 Aug 2006 14:18:58 +0000
parents 6958202c8ee6
children 6a19a83ed49f
files console/plugins/gntgf.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/console/plugins/gntgf.c	Wed Aug 16 11:13:19 2006 +0000
+++ b/console/plugins/gntgf.c	Wed Aug 16 14:18:58 2006 +0000
@@ -34,6 +34,7 @@
 #include <version.h>
 #include <blist.h>
 #include <conversation.h>
+#include <util.h>
 
 #include <gnt.h>
 #include <gntbox.h>
@@ -144,7 +145,18 @@
 received_chat_msg(GaimAccount *account, const char *sender, const char *msg,
 		GaimConversation *conv, GaimMessageFlags flags, gpointer null)
 {
-	if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_NICK) && (flags & GAIM_MESSAGE_NICK))
+	const char *nick;
+
+	if (flags & GAIM_MESSAGE_WHISPER)
+		return;
+	
+	nick = GAIM_CONV_CHAT(conv)->nick;
+
+	if (g_utf8_collate(sender, nick) == 0)
+		return;
+
+	if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_NICK) &&
+			(gaim_utf8_has_word(msg, nick)))
 		notify(_("%s said your nick in %s"), sender, gaim_conversation_get_name(conv));
 	else if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_MSG))
 		notify(_("%s sent a message in %s"), sender, gaim_conversation_get_name(conv));