From: Richard L. <rl...@us...> - 2006-03-17 05:45:53
|
Update of /cvsroot/gaim/gaim/src/protocols/irc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32389/src/protocols/irc Modified Files: msgs.c Log Message: SF Patch #1451956 from Philip Derrin "The IRC client displays any /notice in an IM window, even when the /notice was actually sent to a channel. It does so even if the sender of the /notice is being ignored in that channel. A patch to fix this is attached. I'm aware the fix is a little seedy, but so is the code it's fixing." Index: msgs.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/irc/msgs.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -p -r1.75 -r1.76 --- msgs.c 6 Mar 2006 02:22:15 -0000 1.75 +++ msgs.c 17 Mar 2006 05:45:48 -0000 1.76 @@ -846,10 +846,11 @@ void irc_msg_nickused(struct irc_conn *i void irc_msg_notice(struct irc_conn *irc, const char *name, const char *from, char **args) { - char *newargs[2]; + char *newargs[3]; newargs[0] = " notice "; /* The spaces are magic, leave 'em in! */ newargs[1] = args[1]; + newargs[2] = args[0]; irc_msg_privmsg(irc, name, from, newargs); } @@ -951,7 +952,7 @@ void irc_msg_privmsg(struct irc_conn *ir GaimConnection *gc = gaim_account_get_connection(irc->account); GaimConversation *convo; char *nick = irc_mask_nick(from), *tmp, *msg; - int notice = 0; + gboolean notice = FALSE; if (!args || !args[0] || !args[1] || !gc) { g_free(nick); @@ -959,6 +960,9 @@ void irc_msg_privmsg(struct irc_conn *ir } notice = !strcmp(args[0], " notice "); + if (notice) { + args[0] = args[2]; + } tmp = irc_parse_ctcp(irc, nick, args[0], args[1], notice); if (!tmp) { g_free(nick); @@ -979,8 +983,6 @@ void irc_msg_privmsg(struct irc_conn *ir if (!gaim_utf8_strcasecmp(args[0], gaim_connection_get_display_name(gc))) { serv_got_im(gc, nick, msg, 0, time(NULL)); - } else if (notice) { - serv_got_im(gc, nick, msg, 0, time(NULL)); } else { convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, args[0], irc->account); if (convo) |