aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-13 06:37:59 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-13 06:37:59 -0400
commit7faee2bd0d8534eede405f935c0fc2d0ea356216 (patch)
tree8da4a40c4ad8095269ba0c30ae5deb7fe39976ad
parent74b0b3fcc272d0bda665bc4b30dd9680dc326be3 (diff)
downloadfujinet-chat-7faee2bd0d8534eede405f935c0fc2d0ea356216.tar.gz
/j /join /j1 /join1 now handle multiple channels (space-separated, no commas).
-rw-r--r--TODO3
-rw-r--r--src/cmd.c20
2 files changed, 16 insertions, 7 deletions
diff --git a/TODO b/TODO
index 68047fb..4e95bc9 100644
--- a/TODO
+++ b/TODO
@@ -21,7 +21,8 @@ Other stuff:
be 0x20 or 0x00, they're both "spaces").
- In the config, under SDX, saying "N" to "Settings OK" and then
reloading the config causes screen corruption (reported by
- TheDoctor, not tried it myself).
+ TheDoctor, not tried it myself). The config tool has changed a
+ lot since then, so re-check.
- "User has kicked <yourname> from #channel", the name should be
replaced by "you".
- Gracefully handle nicks/channels whose lengths are stupid long.
diff --git a/src/cmd.c b/src/cmd.c
index 56e5f16..1b0faa5 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -154,23 +154,31 @@ static void join_arg1(void) {
txbuf_send();
}
-static void do_j1(void) {
+static void mass_join(int scr) {
if(have_commas())
return;
- join_arg1();
+ do {
+ arg2 = nextarg(arg1);
+ if(scr) scr_create(arg1, 1);
+ join_arg1();
+ arg1 = arg2;
+ } while(arg1);
+}
+
+static void do_j1(void) {
+ mass_join(0);
}
static void do_j(void) {
if(!arg1)
arg1 = target; /* rejoin channel if window is 'dead' */
+
if(!arg1) {
err_no_scr_target();
return;
}
- if(have_commas())
- return;
- scr_create(arg1, 1);
- do_j1();
+
+ mass_join(1);
}
static void do_quit(void) {