From 632b484974d98742cf67274838fcc4bc2c078e6a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 9 Mar 2026 00:13:54 -0400 Subject: auto-away on ATRACT, auto-un-away on keystroke. --- src/irc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/irc.c') diff --git a/src/irc.c b/src/irc.c index e0bf3b1..5035ace 100644 --- a/src/irc.c +++ b/src/irc.c @@ -19,6 +19,8 @@ char *msg_src, *msg_cmd, *msg_dest, *msg_text; char *msg_args[MAX_MSG_ARGS]; int msg_argcount; +char irc_away = 0; + static char msgbuf[MAX_MSG] = { 0 }; static char *msg; /* with source removed */ static int msgbuf_len = 0, msg_len = 0; @@ -644,6 +646,10 @@ static void start_keystroke(void) { static void keystroke(void) { if(OS.ch == 0xff) return; + if(irc_away) { + txbuf_send_str("AWAY"); + irc_away = 0; + } if(GTIA_READ.consol == 6) { /* start pressed */ start_keystroke(); } else { @@ -654,6 +660,10 @@ static void keystroke(void) { /* only exits on error (e.g. connection closed, which might be via /QUIT). */ void irc_loop(void) { while(1) { + if(!irc_away && (OS.atract & 0x80)) { + irc_away = 1; + txbuf_send_str("AWAY :ATRACT mode"); + } if(!irc_read()) return; keystroke(); } -- cgit v1.2.3