diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-04-27 01:03:51 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-04-27 01:03:51 -0400 |
| commit | 8c0820ada59c3a45c85c7ca1c7b0c9b111ae0967 (patch) | |
| tree | 5dbe1efa89b345f4f028bab524f45e3a654382cb | |
| parent | dd6820b88edc6d52ff9008781a2f27de85c24780 (diff) | |
| download | fujinet-chat-8c0820ada59c3a45c85c7ca1c7b0c9b111ae0967.tar.gz | |
Do not keep displaying a destroyed screen, do not destroy screens 1 and 2.
| -rw-r--r-- | TODO | 22 | ||||
| -rw-r--r-- | src/irc.c | 17 | ||||
| -rw-r--r-- | src/screen.c | 8 |
3 files changed, 27 insertions, 20 deletions
@@ -17,17 +17,20 @@ X Configurable ctcp version response. Not going to do for now. Having Other stuff: +- [*] Rework status bar. We now support 10 screens, and we're going to + support a lot more once extended RAM support gets added. See + doc/new_status_bar.txt. +- [*] Keyboard shortcuts to switch to screens above 7. Also, add + e.g. /10 to switch to screen 10. - [*] sending someone "/me" in a query should highlight red, not white. - [*] edit box issues with the 240th character. currently everything seems to work properly, but you can't type 240 chars (only 239). out of patience for it right now... -- Maybe: get rid of the Hide MOTD and Show PING/PONG preferences. People - can always type /motd if they're interested, and the ping/pong stuff has - been tested thoroughly by now. - [*] Start+A should *always* switch windows, even if all are inactive. It can act like Start+Left in that case. Or (I'm told) Start+Tab might be better? Not sure about that one. -- [*] Auto-pinging the server seems to work, but needs more testing. +- Maybe: get rid of the Hide MOTD preference. People can always type + /motd if they're interested. - If you "/m #channel message" or "/m nick message" from another screen besides the one for #channel or nick, the message should be printed locally in the correct screen, not the current one. Maybe @@ -36,14 +39,11 @@ Other stuff: to have a FujiNet anyway, might as well make better use of it. - Rewrite the incoming message parser! It needs to work more like the command parser in cmd.c: know how many arguments to expect, and - not blindly assume they're present. Also, replace strtok() and - strstr() with nextarg(). + not blindly assume they're present. - *Thoroughly* test the nick and channel tab completion for the [private] and [server] screens. - Fix the nick completion in channel screens. It works, but needs some polishing up. -- More scrollback. Of course it needs more memory... see doc/scrollback.txt - for my ideas on this. - Server /ping command is iffy (see do_server_pong() in irc.c). - "User has kicked <yourname> from #channel", the name should be replaced by "you". @@ -54,13 +54,17 @@ Other stuff: - Add an optional key parameter to /join (key). spec calls for it, I've never seen it used. - *Possibly* save the config from within the client... though not - all options can be changed (really only /nick and /beep). To + all options can be changed (really only /nick, /alert, /click). To make this useful would probably bloat the code too much. Some way to change the IRC server/port within the app would be very useful though. Config file and initial config: +- [*] Don't use an array for channels. Merge channels and extra + channels, which will just be a space-separated list. Client + will join them all, and when it runs out of screens, they get + joined in the server screen. - The config tool should be rewritten in asm, for size. It doesn't need to be fast, but it needs to *load* fast. - The config UI should be nicer. Dialog/curses style, arrows to move, and @@ -209,13 +209,6 @@ static void do_ctcp(char is_notice) { } static void do_privmsg(void) { - /* TODO: this shouldn't be case-sensitive */ - /* - if(strstr(msg_text, config.nick)) - hilite = 1; - else - hilite = 0; - */ hilite = find_nick(); if(*msg_text == '\x01') { @@ -923,11 +916,15 @@ void start_keystroke(char c) { scrollback(); return; case 0x18: /* ^X */ - send_cur_chan_cmd("PART"); + if(scr_current > 2) + send_cur_chan_cmd("PART"); /* fall thru */ case 'x': - scr_prev = SCR_PRIV; - scr_destroy(scr_current); + if(scr_current > 2) { + scr_destroy(scr_current); + scr_current = scr_prev; + scr_prev = SCR_SERVER; + } return; case XCH_LEFT: case '+': diff --git a/src/screen.c b/src/screen.c index dd25938..d090e51 100644 --- a/src/screen.c +++ b/src/screen.c @@ -78,14 +78,20 @@ void scr_destroy(char s) { if(s < 2 || s >= MAX_SCREENS) return; + /* don't destroy if already destroyed (or never created) */ + if(screens[s].status == SCR_UNUSED) + return; + // pool_reclaim_lines(screens[s].pool, screens[s].line_list); pools[screens[s].pool].screen_count--; screens[s].title[0] = 0; screens[s].status = SCR_UNUSED; screens[s].pool = POOL_UNUSED; - screens[s].line_list = 0; screens[s].line_count = screens[s].scrollback_pos = 0; + + /* theoretically this could be 0, but as a safety net... */ + screens[s].line_list = (line_t *)END_MARKER; } void render_vis_buf(void) { |
