diff options
author | Timo Sirainen <cras@irssi.org> | 2000-05-30 14:54:36 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-05-30 14:54:36 +0000 |
commit | 70cc8afa4a1de96f1abe47d60ac7b31e4825ec76 (patch) | |
tree | a06c805b10bffa276adcbbeeff26deb21fcd3642 /src/fe-common/irc/fe-events.c | |
parent | ed140195300797b185b0fa8442166cdd1c927a73 (diff) | |
download | irssi-70cc8afa4a1de96f1abe47d60ac7b31e4825ec76.zip |
when nick is quitting only from one channel, don't print the channel's name.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@254 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-events.c')
-rw-r--r-- | src/fe-common/irc/fe-events.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index f6a2557c..ecd82d59 100644 --- a/src/fe-common/irc/fe-events.c +++ b/src/fe-common/irc/fe-events.c @@ -273,7 +273,7 @@ static void event_quit(const char *data, IRC_SERVER_REC *server, const char *nic GString *chans; GSList *tmp; char *print_channel; - int once; + int once, count; g_return_if_fail(data != NULL); @@ -286,6 +286,8 @@ static void event_quit(const char *data, IRC_SERVER_REC *server, const char *nic print_channel = NULL; once = settings_get_bool("show_quit_once"); + + count = 0; chans = !once ? NULL : g_string_new(NULL); for (tmp = channels; tmp != NULL; tmp = tmp->next) { CHANNEL_REC *rec = tmp->data; @@ -295,17 +297,19 @@ static void event_quit(const char *data, IRC_SERVER_REC *server, const char *nic if (print_channel == NULL || active_win->active == (WI_ITEM_REC *) rec) print_channel = rec->name; - if (once) - g_string_sprintfa(chans, "%s,", rec->name); - else + if (!once) printformat(server, rec->name, MSGLEVEL_QUITS, IRCTXT_QUIT, nick, addr, data); + else { + g_string_sprintfa(chans, "%s,", rec->name); + count++; + } } } if (once) { g_string_truncate(chans, chans->len-1); printformat(server, print_channel, MSGLEVEL_QUITS, - chans->len == 0 ? IRCTXT_QUIT : IRCTXT_QUIT_ONCE, + count <= 1 ? IRCTXT_QUIT : IRCTXT_QUIT_ONCE, nick, addr, data, chans->str); g_string_free(chans, TRUE); } |