1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-30 06:45:25 +00:00

Recode an incoming quit message once with a nick charset preference rather than

doing it for every joined channel the user was in with a channel charset
preference.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4885 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-11-04 14:05:57 +00:00 committed by exg
parent b555e18985
commit 483589efb5

View File

@ -367,6 +367,7 @@ 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;
@ -389,12 +390,10 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
window = window_item_window((WI_ITEM_REC *) rec);
if (g_slist_find(windows, window) == NULL) {
windows = g_slist_append(windows, window);
recoded = recode_in(server, reason, rec->visible_name);
printformat(server, rec->visible_name,
MSGLEVEL_QUITS,
TXT_QUIT, nick, address, recoded,
rec->visible_name);
g_free(recoded);
}
}
count++;
@ -406,24 +405,20 @@ static void sig_message_quit(SERVER_REC *server, const char *nick,
display the quit there too */
QUERY_REC *query = query_find(server, nick);
if (query != NULL) {
recoded = recode_in(server, reason, nick);
printformat(server, nick, MSGLEVEL_QUITS,
TXT_QUIT, nick, address, recoded, "");
g_free(recoded);
}
}
if (once || count == 0) {
if (chans->len > 0)
g_string_truncate(chans, chans->len-1);
/* at least recode_fallback will be used */
recoded = recode_in(server, reason, nick);
printformat(server, print_channel, MSGLEVEL_QUITS,
count <= 1 ? TXT_QUIT : TXT_QUIT_ONCE,
nick, address, recoded, chans->str);
g_free(recoded);
}
g_string_free(chans, TRUE);
g_free(recoded);
}
static void sig_message_kick(SERVER_REC *server, const char *channel,