summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-08 03:15:17 -0500
committerC. McEnroe2020-02-08 03:15:17 -0500
commitb6bf6d62b0bb6d203ce41e4b375c415ca8fde719 (patch)
tree8ef0a65fc49fce6d40ce8e1aff552c25a88f20b5 /command.c
parent2cacf15314be31b33a61007ba6e063ced96c3d41 (diff)
Only show expected topic/names replies
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/command.c b/command.c
index 1d1c756..9879dbe 100644
--- a/command.c
+++ b/command.c
@@ -71,7 +71,15 @@ static void commandMe(size_t id, char *params) {
 }
 
 static void commandJoin(size_t id, char *params) {
+	size_t count = 1;
+	if (params) {
+		for (char *ch = params; *ch && *ch != ' '; ++ch) {
+			if (*ch == ',') count++;
+		}
+	}
 	ircFormat("JOIN %s\r\n", (params ? params : idNames[id]));
+	replies.topic += count;
+	replies.names += count;
 }
 
 static void commandPart(size_t id, char *params) {