summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-11-15 00:53:46 -0500
committerJune McEnroe <june@causal.agency>2019-11-15 00:54:06 -0500
commit11f941bc4c57af40566616bae1e0aca079493356 (patch)
tree4df1e80ec0f7ddc481504edab573570e75a4d3d8
parentAdd concept of passive clients (diff)
downloadpounce-11f941bc4c57af40566616bae1e0aca079493356.tar.gz
pounce-11f941bc4c57af40566616bae1e0aca079493356.zip
Request NAMES on sync by default
This inverts the meaning of -N!
Diffstat (limited to '')
-rw-r--r--bounce.c4
-rw-r--r--bounce.h2
-rw-r--r--pounce.111
-rw-r--r--state.c3
4 files changed, 11 insertions, 9 deletions
diff --git a/bounce.c b/bounce.c
index 1587d81..908a1cb 100644
--- a/bounce.c
+++ b/bounce.c
@@ -237,7 +237,7 @@ int main(int argc, char *argv[]) {
 		{ "cert", required_argument, NULL, 'C' },
 		{ "bind-host", required_argument, NULL, 'H' },
 		{ "priv", required_argument, NULL, 'K' },
-		{ "names", no_argument, NULL, 'N' },
+		{ "no-names", no_argument, NULL, 'N' },
 		{ "bind-port", required_argument, NULL, 'P' },
 		{ "quit", required_argument, NULL, 'Q' },
 		{ "bind-path", required_argument, NULL, 'U' },
@@ -267,7 +267,7 @@ int main(int argc, char *argv[]) {
 			break; case 'C': strlcpy(certPath, optarg, sizeof(certPath));
 			break; case 'H': bindHost = optarg;
 			break; case 'K': strlcpy(privPath, optarg, sizeof(privPath));
-			break; case 'N': stateJoinNames = true;
+			break; case 'N': stateNoNames = true;
 			break; case 'P': bindPort = optarg;
 			break; case 'Q': quit = optarg;
 			break; case 'U': strlcpy(bindPath, optarg, sizeof(bindPath));
diff --git a/bounce.h b/bounce.h
index 5afce01..0e12aa5 100644
--- a/bounce.h
+++ b/bounce.h
@@ -146,7 +146,7 @@ void clientFormat(struct Client *client, const char *format, ...)
 size_t clientDiff(const struct Client *client);
 void clientConsume(struct Client *client);
 
-bool stateJoinNames;
+bool stateNoNames;
 enum Cap stateCaps;
 void stateLogin(
 	const char *pass, bool sasl, const char *plain,
diff --git a/pounce.1 b/pounce.1
index 9a004c4..61b7658 100644
--- a/pounce.1
+++ b/pounce.1
@@ -1,4 +1,4 @@
-.Dd November 14, 2019
+.Dd November 15, 2019
 .Dt POUNCE 1
 .Os
 .
@@ -98,12 +98,13 @@ path for the
 set by
 .Fl H .
 .
-.It Fl N , Cm names
-Request
+.It Fl N , Cm no-names
+Do not request
 .Ql NAMES
 for each channel when a client connects.
-This allows clients to populate user lists,
-but may just cause noise for some.
+This avoids already connected clients
+receiving unsolicited responses
+but prevents new clients from populating user lists.
 .
 .It Fl P Ar port , Cm bind-port = Ar port
 Bind to
diff --git a/state.c b/state.c
index 4103fff..4d3aa1c 100644
--- a/state.c
+++ b/state.c
@@ -393,6 +393,7 @@ void stateSync(struct Client *client) {
 				ORIGIN, self.nick, chan->name, chan->topic
 			);
 		}
-		if (stateJoinNames) serverFormat("NAMES %s\r\n", chan->name);
+		if (stateNoNames) continue;
+		serverFormat("NAMES %s\r\n", chan->name);
 	}
 }