From 7faee2bd0d8534eede405f935c0fc2d0ea356216 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 13 Mar 2026 06:37:59 -0400 Subject: /j /join /j1 /join1 now handle multiple channels (space-separated, no commas). --- TODO | 3 ++- src/cmd.c | 20 ++++++++++++++------ 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 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) { -- cgit v1.2.3