1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Move recoding of incoming quit messages to irc 'event quit' handler.

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4889 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-11-09 23:06:37 +00:00 committed by exg
parent c647f8b206
commit 9ce4352e1d
2 changed files with 9 additions and 7 deletions

View File

@ -356,7 +356,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
WINDOW_REC *window;
GString *chans;
GSList *tmp, *windows;
char *print_channel, *recoded;
char *print_channel;
int once, count;
if (ignore_check(server, nick, address, NULL, reason, MSGLEVEL_QUITS))
@ -367,7 +367,6 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
count = 0; windows = NULL;
chans = g_string_new(NULL);
recoded = recode_in(server, reason, nick);
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
CHANNEL_REC *rec = tmp->data;
@ -392,7 +391,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
windows = g_slist_append(windows, window);
printformat(server, rec->visible_name,
MSGLEVEL_QUITS,
TXT_QUIT, nick, address, recoded,
TXT_QUIT, nick, address, reason,
rec->visible_name);
}
}
@ -406,7 +405,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
QUERY_REC *query = query_find(server, nick);
if (query != NULL) {
printformat(server, nick, MSGLEVEL_QUITS,
TXT_QUIT, nick, address, recoded, "");
TXT_QUIT, nick, address, reason, "");
}
}
@ -415,10 +414,9 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
g_string_truncate(chans, chans->len-1);
printformat(server, print_channel, MSGLEVEL_QUITS,
count <= 1 ? TXT_QUIT : TXT_QUIT_ONCE,
nick, address, recoded, chans->str);
nick, address, reason, chans->str);
}
g_string_free(chans, TRUE);
g_free(recoded);
}
static void sig_message_kick(SERVER_REC *server, const char *channel,

View File

@ -140,10 +140,14 @@ static void event_part(IRC_SERVER_REC *server, const char *data,
static void event_quit(IRC_SERVER_REC *server, const char *data,
const char *nick, const char *addr)
{
char *recoded;
g_return_if_fail(data != NULL);
if (*data == ':') data++; /* quit message */
signal_emit("message quit", 4, server, nick, addr, data);
recoded = recode_in(SERVER(server), data, nick);
signal_emit("message quit", 4, server, nick, addr, recoded);
g_free(recoded);
}
static void event_kick(IRC_SERVER_REC *server, const char *data,