aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-22 06:03:13 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-22 06:03:13 -0400
commitee3f5a950618104c3e34766dc3ab539a51b6968a (patch)
tree357955649a59fdbdf2dc0325ce0ee6612fa8c92c /src
parent57fdf0bc1f50e75800d3ca2e14bace577161bdaf (diff)
downloadfujinet-chat-ee3f5a950618104c3e34766dc3ab539a51b6968a.tar.gz
Add 4th status color, stop auto-activating screen before we print text to it.
Diffstat (limited to 'src')
-rw-r--r--src/irc.c19
-rw-r--r--src/screen.c7
-rw-r--r--src/screen.h1
3 files changed, 24 insertions, 3 deletions
diff --git a/src/irc.c b/src/irc.c
index d9f19aa..4f791d7 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -30,6 +30,7 @@ char irc_away = 0;
char bell_type;
char hide_motd;
char start_latch = 0;
+char new_scr_status;
static char msgbuf[MAX_MSG] = { 0 };
static char *msg; /* with source removed */
@@ -83,7 +84,8 @@ static void hilite_bold(void) {
static void do_chan_nick(void) {
if(hilite) {
bell();
- scr_hilite_active();
+ // scr_hilite_active();
+ new_scr_status = SCR_HILITE;
}
hilite_bold();
scr_print_active("<");
@@ -105,7 +107,8 @@ static void do_priv_nick(void) {
scr_print_active("*");
scr_print_active(msg_src);
scr_print_active("* ");
- scr_hilite_active();
+ // scr_hilite_active();
+ new_scr_status = SCR_HILITE;
bell();
}
}
@@ -534,9 +537,12 @@ void select_screen(void) {
static void dispatch_msg(void) {
/* at this point, we know the message source and destination, so: */
+ /* FIXME: maybe we know... */
select_screen();
+ new_scr_status = SCR_OTHER;
if(streq_i(msg_cmd, "PRIVMSG")) {
+ new_scr_status = SCR_ACTIVE;
do_privmsg();
} else if(streq_i(msg_cmd, "NOTICE")) {
do_notice();
@@ -561,6 +567,11 @@ static void dispatch_msg(void) {
} else {
do_catchall(0);
}
+
+ if(scr_active != scr_current) {
+ scr_status[scr_active] = new_scr_status;
+ scr_show_status(scr_current);
+ }
}
/* msgbuf contains a complete message from the server, whose
@@ -876,6 +887,8 @@ void switch_to_active() {
i = find_scr_with_status(SCR_HILITE);
if(i == 0xff)
i = find_scr_with_status(SCR_ACTIVE);
+ if(i == 0xff)
+ i = find_scr_with_status(SCR_OTHER);
if(i != 0xff) {
scr_prev = scr_current;
scr_display(i);
@@ -1020,12 +1033,12 @@ static void keystroke(void) {
txbuf_send_str("AWAY");
irc_away = 0;
}
- OS.cdtmv3 = hz / 3;
if(GTIA_READ.consol == 6 || start_latch) { /* start pressed */
start_keystroke();
} else {
edbox_keystroke();
}
+ OS.cdtmv3 = hz / 3;
}
/* only exits on error (e.g. connection closed, which might be via /QUIT). */
diff --git a/src/screen.c b/src/screen.c
index 350a60c..3c61f01 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -150,6 +150,9 @@ void scr_show_status(char s) {
case SCR_ACTIVE: /* color1 */
sc |= 0x40;
break;
+ case SCR_OTHER: /* color2 */
+ sc |= 0x80;
+ break;
case SCR_HILITE: /* color3 */
sc |= 0xc0;
break;
@@ -168,11 +171,13 @@ void scr_show_status(char s) {
}
}
+/*
void scr_hilite_active(void) {
if(scr_active == scr_current) return;
scr_status[scr_active] = SCR_HILITE;
scr_show_status(scr_current);
}
+*/
void scr_refresh(void) {
scr_display(scr_current);
@@ -286,10 +291,12 @@ void scr_print_priv(const char *text) {
}
void scr_activate(char s) {
+ /*
if(s != scr_current) {
if(scr_status[s] != SCR_HILITE) scr_status[s] = SCR_ACTIVE;
scr_show_status(scr_current);
}
+ */
scr_active = s;
}
diff --git a/src/screen.h b/src/screen.h
index 787310d..9acd720 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -9,6 +9,7 @@
#define SCR_INACTIVE 1
#define SCR_ACTIVE 2
#define SCR_HILITE 3
+#define SCR_OTHER 4
#define SCR_SERVER 0
#define SCR_PRIV 1