diff --git a/catgirl.1 b/catgirl.1 index 1b74b6c..bb425cc 100644 --- a/catgirl.1 +++ b/catgirl.1 @@ -1,4 +1,4 @@ -.Dd July 2, 2021 +.Dd July 20, 2021 .Dt CATGIRL 1 .Os . @@ -8,7 +8,7 @@ . .Sh SYNOPSIS .Nm -.Op Fl KRelv +.Op Fl KRelqv .Op Fl C Ar copy .Op Fl H Ar hash .Op Fl I Ar highlight @@ -323,6 +323,11 @@ Connect to .Ar port . The default port is 6697. . +.It Fl q | Cm quiet +Raise the default message visibility threshold +for new windows, +hiding general events. +. .It Fl r Ar real | Cm real No = Ar real Set realname to .Ar real . diff --git a/chat.c b/chat.c index 106e05f..3141052 100644 --- a/chat.c +++ b/chat.c @@ -257,6 +257,7 @@ int main(int argc, char *argv[]) { { .val = 'n', .name = "nick", required_argument }, { .val = 'o', .name = "print-chain", no_argument }, { .val = 'p', .name = "port", required_argument }, + { .val = 'q', .name = "quiet", no_argument }, { .val = 'r', .name = "real", required_argument }, { .val = 's', .name = "save", required_argument }, { .val = 't', .name = "trust", required_argument }, @@ -300,6 +301,7 @@ int main(int argc, char *argv[]) { break; case 'n': nick = optarg; break; case 'o': printCert = true; break; case 'p': port = optarg; + break; case 'q': uiThreshold = Warm; break; case 'r': real = optarg; break; case 's': save = optarg; break; case 't': trust = optarg; diff --git a/chat.h b/chat.h index c247dd7..dd9c823 100644 --- a/chat.h +++ b/chat.h @@ -292,6 +292,7 @@ void commandCompleteAdd(void); enum Heat { Ice, Cold, Warm, Hot }; enum { TimeCap = 64 }; +extern enum Heat uiThreshold; extern struct Time { bool enable; const char *format; diff --git a/ui.c b/ui.c index da06342..3604057 100644 --- a/ui.c +++ b/ui.c @@ -127,6 +127,8 @@ static struct Window *windowRemove(uint num) { return window; } +enum Heat uiThreshold = Cold; + static uint windowFor(uint id) { for (uint num = 0; num < windows.len; ++num) { if (windows.ptrs[num]->id == id) return num; @@ -136,7 +138,7 @@ static uint windowFor(uint id) { window->id = id; window->mark = true; window->time = uiTime.enable; - window->thresh = Cold; + window->thresh = uiThreshold; window->buffer = bufferAlloc(); completeAdd(None, idNames[id], idColors[id]); return windowPush(window);