aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-10 04:20:27 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-10 04:20:27 -0400
commitced2f97c201def0356f0fa0601b3c7ad5fb71a6c (patch)
tree6e2374ee81bca59b4bf9909c584a4913042f19fb /src
parentb4d44860c237c05447f5641f83f19cece2ac9975 (diff)
downloadfujinet-chat-ced2f97c201def0356f0fa0601b3c7ad5fb71a6c.tar.gz
Start+Q to open a screen for the last channel/nick we got a message from.
Diffstat (limited to 'src')
-rw-r--r--src/irc.c13
-rw-r--r--src/irc.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/src/irc.c b/src/irc.c
index ab630d3..9a5b7a9 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -34,6 +34,7 @@ static char scr_prev = SCR_PRIV;
char numbuf[10];
char last_pm_nick[33];
+char last_chan[33]; /* without a screen */
/*
static void join_channel(void) {
@@ -442,7 +443,10 @@ void select_screen(void) {
s = SCR_SERVER;
} else if(*msg_dest == '#') {
s = scr_getbyname(msg_dest);
- if(!s) s = SCR_SERVER;
+ if(!s) {
+ strncpy(last_chan, msg_dest, 32);
+ s = SCR_SERVER;
+ }
} else {
s = scr_getbyname(msg_src);
if(!s) {
@@ -740,8 +744,13 @@ static void start_keystroke(void) {
return;
case 'q':
case 'Q':
- if(*last_pm_nick)
+ if(scr_current == SCR_PRIV && *last_pm_nick) {
scr_create(last_pm_nick, 1);
+ *last_pm_nick = 0;
+ } else if(scr_current == SCR_SERVER && *last_chan) {
+ scr_create(last_chan, 1);
+ *last_chan = 0;
+ }
return;
case 'a':
case 'A':
diff --git a/src/irc.h b/src/irc.h
index 0d91d3f..4b57df3 100644
--- a/src/irc.h
+++ b/src/irc.h
@@ -49,6 +49,7 @@ extern int msg_argcount;
extern char irc_away;
extern char bell_type;
extern char last_pm_nick[33];
+extern char last_chan[33];
/* call this once, right after TCP connection is established. */
void irc_register(void);