# HG changeset patch # User Sadrul Habib Chowdhury # Date 1155737938 0 # Node ID 55e3db9db9f62fa14a3e8e6c60fc1b6a51750632 # Parent 6958202c8ee624fca17917deb9266c3a0c7d9fc2 [gaim-migrate @ 16789] Update gntgf to work for nick-said messages in chats. committer: Tailor Script diff -r 6958202c8ee6 -r 55e3db9db9f6 console/plugins/gntgf.c --- 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 #include #include +#include #include #include @@ -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));