[gaim-migrate @ 16789]

Wed, 16 Aug 2006 14:18:58 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Wed, 16 Aug 2006 14:18:58 +0000
changeset 14208
688c4907d9c4
parent 14207
ec7a75cb8093
child 14209
f629f12af598

[gaim-migrate @ 16789]
Update gntgf to work for nick-said messages in chats.

console/plugins/gntgf.c file | annotate | diff | comparison | revisions
--- 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));

mercurial