mirror of
https://github.com/irssi/irssi.git
synced 2025-04-27 05:21:16 -05:00
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
This commit is contained in:
parent
ed14019530
commit
70cc8afa4a
@ -273,7 +273,7 @@ static void event_quit(const char *data, IRC_SERVER_REC *server, const char *nic
|
|||||||
GString *chans;
|
GString *chans;
|
||||||
GSList *tmp;
|
GSList *tmp;
|
||||||
char *print_channel;
|
char *print_channel;
|
||||||
int once;
|
int once, count;
|
||||||
|
|
||||||
g_return_if_fail(data != NULL);
|
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;
|
print_channel = NULL;
|
||||||
once = settings_get_bool("show_quit_once");
|
once = settings_get_bool("show_quit_once");
|
||||||
|
|
||||||
|
count = 0;
|
||||||
chans = !once ? NULL : g_string_new(NULL);
|
chans = !once ? NULL : g_string_new(NULL);
|
||||||
for (tmp = channels; tmp != NULL; tmp = tmp->next) {
|
for (tmp = channels; tmp != NULL; tmp = tmp->next) {
|
||||||
CHANNEL_REC *rec = tmp->data;
|
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)
|
if (print_channel == NULL || active_win->active == (WI_ITEM_REC *) rec)
|
||||||
print_channel = rec->name;
|
print_channel = rec->name;
|
||||||
|
|
||||||
if (once)
|
if (!once)
|
||||||
g_string_sprintfa(chans, "%s,", rec->name);
|
|
||||||
else
|
|
||||||
printformat(server, rec->name, MSGLEVEL_QUITS, IRCTXT_QUIT, nick, addr, data);
|
printformat(server, rec->name, MSGLEVEL_QUITS, IRCTXT_QUIT, nick, addr, data);
|
||||||
|
else {
|
||||||
|
g_string_sprintfa(chans, "%s,", rec->name);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (once) {
|
if (once) {
|
||||||
g_string_truncate(chans, chans->len-1);
|
g_string_truncate(chans, chans->len-1);
|
||||||
printformat(server, print_channel, MSGLEVEL_QUITS,
|
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);
|
nick, addr, data, chans->str);
|
||||||
g_string_free(chans, TRUE);
|
g_string_free(chans, TRUE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user