diff --git a/README.md b/README.md index d89f2ea..1017246 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ around. make ./irc9 # finds a config automatically (see below) ./irc9 myconfig.conf # or point at a config explicitly -./irc9 -s myconfig.conf # hide join and quit notices in channel windows +./irc9 -s myconfig.conf # hide channel activity notices ``` -`-s` and `--silent` hide JOIN and QUIT notices in channel windows. +`-s` and `--silent` hide channel join, quit, leave, and sync notices. `-C` and `--colored` color nicknames in channel and private chats and in nicklists. Your own nick is always green in this mode, including in the status line. diff --git a/irc9.c b/irc9.c index c784bb9..d803cf6 100644 --- a/irc9.c +++ b/irc9.c @@ -1247,7 +1247,7 @@ static void handle_line(Server *s, char *line) w = window_get(s, arg[0], W_CHANNEL); member_remove(w, nick); } - append_nickf(w, "* ", hostmask ? hostmask : "someone", " ", "left %s%s", arg[0], why); + if (!silent) append_nickf(w, "* ", hostmask ? hostmask : "someone", " ", "left %s%s", arg[0], why); return; } @@ -1384,16 +1384,16 @@ static void handle_line(Server *s, char *line) if (!w) w = window_get(s, arg[1], W_CHANNEL); if (w->type == W_CHANNEL) { show_names(w); - if (w->syncing) { + if (!silent && w->syncing) { struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); double dt = (now.tv_sec - w->join_ts.tv_sec) + (now.tv_nsec - w->join_ts.tv_nsec) / 1e9; appendf(w, "* synced %s in %.2fs", w->name, dt); - w->syncing = 0; - } else { + } else if (!silent) { appendf(w, "* synced %s", w->name); } + w->syncing = 0; } } return;