aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-13 18:25:08 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-13 18:25:08 -0400
commit080bac18c9bbca1029081745967b69766de7575e (patch)
tree375a3346ced5f6eb6ffd46aa819eb270a94455a0
parent7faee2bd0d8534eede405f935c0fc2d0ea356216 (diff)
downloadfujinet-chat-080bac18c9bbca1029081745967b69766de7575e.tar.gz
Allow multiple nicks with /query.
-rw-r--r--TODO7
-rw-r--r--doc/commands.txt102
-rw-r--r--src/cmd.c19
3 files changed, 85 insertions, 43 deletions
diff --git a/TODO b/TODO
index 4e95bc9..46b1d76 100644
--- a/TODO
+++ b/TODO
@@ -34,13 +34,6 @@ Other stuff:
- Autojoin on startup (see config file section below). Partially done.
- Add an optional key parameter to /join (key). spec calls for it,
I've never seen it used.
-- Allow mass joins as "/join #chan1 #chan2 #chan3" (without commas).
- If someone does need channel keys, we can support that with
- a 2-arg /join whose 2nd arg doesn't start with #... unless
- the key starts with #! Give this further thought.
-- Allow creating multiple queries as "/query jim bob joe".
-- /join also supports "/join 0", which parts all channels. don't
- have to do anything special for it, but do document it.
- 'Dead' screens (channels we've parted, or failed to join) should
show some kind of indicator, and not accept input. Although maybe
this isn't worth doing (you already get "cannot send to channel").
diff --git a/doc/commands.txt b/doc/commands.txt
index 94e165d..4ca5c4a 100644
--- a/doc/commands.txt
+++ b/doc/commands.txt
@@ -10,89 +10,139 @@ Anything that starts with / that isn't listed here gets sent to the
IRC server as-is, minus the /. That's why /nick, /who, /whois aren't
listed here, for instance.
-/j <channel>
-/join <channel>
-Joins a channel, creates a new screen if possible. If a screen can't
-be created, channel text will be sent to the [server] screen, and
-"/m #channel" must be used, to send to the channel.
-
-/j1 <channel>
-/join1 <channel>
-Joins a channel without creating a new screen. Channel test will be
+--------------------------------------------------------------------
+/j <channel> [<channel> ...]
+/join <channel> [<channel> ...]
+
+Joins one or more channels, creates new screens if possible. If a
+screen can't be created, channel text will be sent to the [server]
+screen, and "/m #channel" must be used, to send to the channel.
+
+Also, you can use "/join 0" to leave (part) every channel you're
+in. If you do this, the channel screens won't be closed.
+
+The IRC protocol has an optional rarely-used "key" parameter, which
+works like a password to get into a channel. This isn't directly
+supported in FujiNetChat, but you can do this:
+
+ /quote join <channel> <key>
+ /query <channel>
+
+...although that channel won't be automatically rejoined if you
+disconnect and reconnect.
+
+--------------------------------------------------------------------
+/j1 <channel> [<channel> ...]
+/join1 <channel> [<channel> ...]
+
+Joins a channel without creating a new screen. Channel text will be
sent to the [server] screen. Use "/m #channel" to send to the channel.
+--------------------------------------------------------------------
/m <nick|channel> <text>
/msg <nick|channel> <text>
-PRIVMSG to nick or channel.
-/q <nick> [<msg>]
-/query <nick> [<msg>]
-Creates a screen for PMs to/from <nick> if possible. If <msg> is
-given, sends it to the <nick>. <nick> can also be a channel, which
-creates a channel screen for a channel that doesn't already have
-its own screen.
+Send a message to a nick or channel.
+
+--------------------------------------------------------------------
+/q <nick|channel> [<nick|channel> ...]
+/query <nick|channel> [<nick|channel> ...]
+
+Creates screens for messages to/from one or more nicks, if possible.
+Can also be a channels, which creates channel screens for a channels
+that doesn't already have their own screens.
+--------------------------------------------------------------------
/quit [<msg>]
Quits IRC with optional quit message.
-/p [#chan] [<msg>]
-/part [#chan] [<msg>]
-Parts (leaves) a channel. If no #chan is given, the current screen's
+--------------------------------------------------------------------
+/p [<channel>] [<msg>]
+/part [<channel>] [<msg>]
+
+Parts (leaves) a channel. If no channel is given, the current screen's
channel is parted (if you're in a channel screen). If there's a screen
-for the channel, it gets closed.
+for the channel, it DOES NOT get closed (it will be re-used if you
+join the channel again). To part a channel and close its screen,
+use Start+Control+X.
+--------------------------------------------------------------------
/names [<channel>]
+
Shows the list of users in a channel. Uses the current screen's channel,
if no <channel> given. On most networks, it's not very useful to use
/names on a channel you haven't joined.
+--------------------------------------------------------------------
/topic [<channel>]
+
Shows the channel topic and its creator. With no <channel>, uses the
current screen's channel.
+--------------------------------------------------------------------
/ping [<nick>]
+
With no argument: ping the server. With arg: CTCP ping the nick.
-The contents of RTCLOK are sent as the ping data, so when the
-PONG response is received, the round-trip time can be shown, with
-up to 1/60 (NTSC) or 1/50 (PAL) second accuracy.
-TODO: not implemented yet.
+When the ping response is received, the latency (round trip time)
+will be calculated and printed in the [server] screen.
+--------------------------------------------------------------------
/me <action>
+
CTCP ACTION. Only works in a channel or query screen (eventually
it'll work in [server] and [private] too)
-/ver <nick>
-CTCP VERSION.
+--------------------------------------------------------------------
+/ver [<nick>]
+With <nick>, sends a CTCP VERSION request. Without <nick>, gets
+the server's version information.
+
+--------------------------------------------------------------------
/info [<nick>]
+
With <nick>, CTCP CLIENTINFO. Without <nick>, INFO command for the
server.
+--------------------------------------------------------------------
/ctcp <nick> <command> [<text>]
+
Send arbitrary CTCP commands.
+--------------------------------------------------------------------
/list <arg(s)>
+
This command will be sent to the server as-is. The only reason it's a
local command is so the argument can be required: sending LIST without
any arguments lists every channel on the server, which isn't useful.
+--------------------------------------------------------------------
/color <bg> [<fg>] [<status-active>] [<status-highlight>]
+
Set colors. This should be on a per-screen basis, eventually.
TODO: this only takes bg and fg arguments, currently.
+--------------------------------------------------------------------
/click
+
Toggles the keyclick sound, if you're on an Atari XL or XE. On the
400/800, it does nothing (sorry).
+--------------------------------------------------------------------
/chans
+
List all channels we've joined. This will actually be limited to
something like 20 (who joins more than 20 channels anyway?)
TODO: not implemented yet.
+--------------------------------------------------------------------
/quote <cmd>
+
Send raw IRC protocol to the server. This bypasses local command
parsing.
+--------------------------------------------------------------------
/alert <number>
+
Set the type of alert that happens when you're PMed or highlighted
in a channel. 0 = none, 1 = beep, 2 = flash, 3 = beep and flash.
diff --git a/src/cmd.c b/src/cmd.c
index 1b0faa5..ced02fe 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -373,16 +373,15 @@ static void do_color(void) {
}
static void do_query(void) {
- if(scr_create(arg1, 1) == 0xff) {
- err_marker();
- scr_print_current("Can't create query, all screens in use\n");
- return;
- }
- /*
- scr_print_current("Starting conversation with ");
- scr_print_current(arg1);
- scr_eol_current();
- */
+ do {
+ arg2 = nextarg(arg1);
+ if(scr_create(arg1, 1) == 0xff) {
+ err_marker();
+ scr_print_current("Query: all screens in use\n");
+ return;
+ }
+ arg1 = arg2;
+ } while(arg1);
}
static void do_msg(void) {