comparison console/plugins/gntgf.c @ 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 44ec6c7cbc76
children d822e68acb3e
comparison
equal deleted inserted replaced
14145:6958202c8ee6 14146:55e3db9db9f6
32 32
33 #include <plugin.h> 33 #include <plugin.h>
34 #include <version.h> 34 #include <version.h>
35 #include <blist.h> 35 #include <blist.h>
36 #include <conversation.h> 36 #include <conversation.h>
37 #include <util.h>
37 38
38 #include <gnt.h> 39 #include <gnt.h>
39 #include <gntbox.h> 40 #include <gntbox.h>
40 #include <gntbutton.h> 41 #include <gntbutton.h>
41 #include <gntlabel.h> 42 #include <gntlabel.h>
142 143
143 static void 144 static void
144 received_chat_msg(GaimAccount *account, const char *sender, const char *msg, 145 received_chat_msg(GaimAccount *account, const char *sender, const char *msg,
145 GaimConversation *conv, GaimMessageFlags flags, gpointer null) 146 GaimConversation *conv, GaimMessageFlags flags, gpointer null)
146 { 147 {
147 if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_NICK) && (flags & GAIM_MESSAGE_NICK)) 148 const char *nick;
149
150 if (flags & GAIM_MESSAGE_WHISPER)
151 return;
152
153 nick = GAIM_CONV_CHAT(conv)->nick;
154
155 if (g_utf8_collate(sender, nick) == 0)
156 return;
157
158 if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_NICK) &&
159 (gaim_utf8_has_word(msg, nick)))
148 notify(_("%s said your nick in %s"), sender, gaim_conversation_get_name(conv)); 160 notify(_("%s said your nick in %s"), sender, gaim_conversation_get_name(conv));
149 else if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_MSG)) 161 else if (gaim_prefs_get_bool(PREFS_EVENT_CHAT_MSG))
150 notify(_("%s sent a message in %s"), sender, gaim_conversation_get_name(conv)); 162 notify(_("%s sent a message in %s"), sender, gaim_conversation_get_name(conv));
151 } 163 }
152 164