diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-02 22:03:10 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-02 22:03:10 -0500 |
| commit | dc6297d5df43f87d1ed2ea1b5c1f5a5193ec235a (patch) | |
| tree | 74d28b3aa042a2fb0e5ed5b774db869325da7bda /src | |
| parent | ba295fcffbd353e45297bbeec96f681bb4f2e00e (diff) | |
| download | fujinet-chat-dc6297d5df43f87d1ed2ea1b5c1f5a5193ec235a.tar.gz | |
Fix "nick already in use" and permutation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd.c | 4 | ||||
| -rw-r--r-- | src/edbox.c | 5 | ||||
| -rw-r--r-- | src/irc.c | 29 |
3 files changed, 29 insertions, 9 deletions
@@ -25,9 +25,8 @@ static void cmd_chan_text(void) { scr_print_active("/"); scr_print_active(target); } - scr_print_active(" "); + scr_print_active("> "); scr_print_active(command); - scr_print_active(">"); scr_eol_active(); txbuf_set_str("PRIVMSG "); @@ -54,5 +53,6 @@ void cmd_command(const char *cmd) { } void cmd_execute(void) { + if(!*edit_box) return; cmd_command(edit_box); } diff --git a/src/edbox.c b/src/edbox.c index 0903cb9..167bdc2 100644 --- a/src/edbox.c +++ b/src/edbox.c @@ -200,6 +200,8 @@ void edbox_keystroke(void) { case 0x3c: /* caps */ OS.shflok ^= 0x40; keyclick(); + OS.ch = 0xff; + return; break; case 0x7c: /* shift-caps */ case 0xbc: /* ctrl-caps */ @@ -207,7 +209,8 @@ void edbox_keystroke(void) { case 0x67: /* ...w/shift */ case 0x97: /* ...w/ctrl */ case 0x9a: /* ctrl-3 (crash if cgetc() reads it!) */ - return; /* ignore it! */ + OS.ch = 0xff; /* ignore it! */ + return; break; default: break; @@ -7,6 +7,7 @@ #include "screen.h" #include "edbox.h" #include "numerics.h" +#include "keyclick.h" #include <atari.h> #include <conio.h> @@ -31,6 +32,11 @@ static void join_channel(void) { } */ +static void send_nick(void) { + txbuf_set_str2("NICK ", usernick); + txbuf_send(); +} + static void print_reason(void) { if(msg_text) { scr_print_active(": "); @@ -60,8 +66,9 @@ static void do_chan_nick(void) { scr_print_active(msg_dest); } hilite_bold(); - scr_print_active("> "); + scr_print_active(">"); hilite_bold(); + scr_print_active(" "); } static void do_priv_nick(void) { @@ -258,7 +265,7 @@ static void do_numeric(void) { do_catchall(0); if(!regged) { permute_nick(); - irc_register(); + send_nick(); } break; @@ -363,7 +370,7 @@ static void parse_msg(void) { } if(*p == ':') { - msg_src = p; /* generally :irc.example.com or :nick!user@host */ + msg_src = p + 1; /* generally :irc.example.com or :nick!user@host */ msg_cmd = strtok(0, " "); } else { msg_src = 0; /* no source supplied */ @@ -395,7 +402,6 @@ static void parse_msg(void) { if(msg_src) { if((p = strstr(msg_src, "!"))) { - msg_src++; *p = '\0'; } else if(strstr(msg_src, ".")) { msg_src = 0; @@ -486,8 +492,17 @@ void irc_register(void) { txbuf_set_str3("USER ", usernick, " 0 * :FujiNetChat User"); txbuf_send(); - txbuf_set_str2("NICK ", usernick); - txbuf_send(); + send_nick(); +} + +static void scrollback() { + OS.ch = 0xff; + scr_scrollback(); + while(OS.ch == 0xff) + /* NOP */ ; + keyclick(); + OS.ch = 0xff; + scr_end_scrollback(); } static void start_keystroke(void) { @@ -498,6 +513,8 @@ static void start_keystroke(void) { s = i - '1'; if(scr_status[s] != SCR_UNUSED) scr_display(s); + } else if(i == CH_CURS_UP || i == '-') { + scrollback(); } } |
