aboutsummaryrefslogtreecommitdiff
path: root/src/cmd.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-09 00:13:54 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-09 00:13:54 -0400
commit632b484974d98742cf67274838fcc4bc2c078e6a (patch)
treee6008fda9043366238b851449ae53eda7482dd6f /src/cmd.c
parent05c066e18ac9ad909379634089813350841ce70e (diff)
downloadfujinet-chat-632b484974d98742cf67274838fcc4bc2c078e6a.tar.gz
auto-away on ATRACT, auto-un-away on keystroke.
Diffstat (limited to 'src/cmd.c')
-rw-r--r--src/cmd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cmd.c b/src/cmd.c
index 5be0fd5..ea6d6cf 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -12,6 +12,7 @@
char *command, *arg1, *arg2, *arg3;
static char *target;
+static void do_away(void);
static void do_color(void);
static void do_ctcp(void);
static void do_info(void);
@@ -36,9 +37,10 @@ typedef struct {
} cmd_t;
/* future commands:
- AWAY OP DEOP VOICE DEVOICE KICK BAN KB IGNORE UNIGNORE MODE
+ OP DEOP VOICE DEVOICE KICK BAN KB IGNORE UNIGNORE MODE
*/
cmd_t command_defs[] = {
+ { "AWAY", do_away, 1 },
{ "COLOR", do_color, 1 },
{ "CTCP", do_ctcp, 1 },
{ "INFO", do_info, 0 },
@@ -344,6 +346,13 @@ static void do_msg(void) {
}
}
+static void do_away(void) {
+ OS.atract = 0x80;
+ irc_away = 1;
+ txbuf_set_str2("AWAY :", arg1);
+ txbuf_send();
+}
+
static int cmd_local(void) {
arg1 = nextarg(command);