Commit Graph

124 Commits (4b26ae23cd24cc59d6d387a4e2d9cea7a8812318)

Author SHA1 Message Date
C. McEnroe b4c26a2cab Measure timestamp width using ncurses
This allows for non-ASCII characters in timestamps, and simplifies
things by including the trailing space in the width.
2021-01-27 14:55:31 -05:00
C. McEnroe c118c594e3 Add toggleable display of timestamps 2021-01-27 00:15:46 -05:00
C. McEnroe 52c58128c8 Add numbers to buffer lines
This directly correlates hard-wrapped lines with the soft lines
they were wrapped from.

Choosing uint here because it doesn't change the size of struct
Line. It doesn't at all matter since buffers only hold 1024 lines
at a time anyway.
2021-01-26 22:14:12 -05:00
C. McEnroe 95bb627ffb Separate kiosk mode from restrict mode
Restrict mode will focus on sandboxing, while kiosk will continue
to restrict IRC access through a public kiosk. Kiosk mode without
restrict mode allows execution of man 1 catgirl with /help, assuming
external sandboxing.

The /list and /part commands are also added to the list of disabled
commands in kiosk mode, since they are pointless without access to
/join.
2021-01-23 00:48:15 -05:00
C. McEnroe 5a490945ea Rename ignore code to filter 2021-01-16 13:36:39 -05:00
C. McEnroe d05872303e Generalize ignore toggling to visibility threshold 2021-01-16 12:58:16 -05:00
C. McEnroe 51c92f94ff Save and load the URL ring in the save file 2021-01-11 18:05:22 -05:00
C. McEnroe c6cd90c2dd Print chain to stdout with -o 2021-01-10 18:00:41 -05:00
C. McEnroe e42b3aa08e Add -o and -t options to trust self-signed certificates 2021-01-09 19:11:57 -05:00
C. McEnroe a324795b86 Allow configuring the upper bound of the hash function
This allows limiting the nick colors used to the 16-color terminal set
without modifying the TERM environment variable. Produces different
results from just using the default configuration in a 16-color
terminal, but what can you do?
2021-01-09 17:58:29 -05:00
C. McEnroe 4b883177dc Split ignore fields to avoid over-eager * matching
Split ignore fields and match each separately to avoid an early *
eagerly matching across several fields. For example, "* JOIN * *" should
not match messages which happen to contain the word "JOIN" followed by
two other words.

Ignore capacity is reduced to 64 to keep the size of the array the same.
I don't think it's an issue.
2021-01-01 20:09:10 -05:00
C. McEnroe 519fcc436f Factor out reply count checking and decrementing 2020-12-30 16:54:03 -05:00
C. McEnroe 8b6a476c35 Add /whowas 2020-12-30 14:29:32 -05:00
C. McEnroe 05fbcb41c9 Show setnames like nick changes 2020-12-30 00:19:52 -05:00
C. McEnroe 1662b01a5f Add /setname command
I'm not sure about that replies check in handleStandardReply. If more of
those are added the reply counter system will definitely need
refactoring.
2020-12-29 23:54:30 -05:00
C. McEnroe 59006d18bb Avoid eating C-c while connecting
Split UI initialization into two steps either side of the call to
connect, so that C-c works as interrupt while it's blocked.
2020-10-12 19:25:08 -04:00
C. McEnroe c48672313b Factor out styleStrip 2020-10-09 18:45:52 -04:00
C. McEnroe f7f5acbbe2 Double up /help for server help
While the automatic search via LESS is neat, I don't think it's very
useful. Just always open the manual to the COMMANDS section, and fix it
to append to LESS rather than replace it.
2020-10-02 19:38:37 -04:00
C. McEnroe f3a56b0d01 Use WHO for /ops
Accumulate names in a buffer and show away status.
2020-09-30 19:21:34 -04:00
C. McEnroe 3e67bf6557 Add /ops command
It's pretty awkward with large channels since NAMES isn't sorted by
prefixes or anything... But having it accumulate names across many
replies would require more reworking.
2020-09-30 17:52:39 -04:00
C. McEnroe 0968a8ac7c Recalculate unreadHard on reflow 2020-09-02 21:29:03 -04:00
C. McEnroe 96386adac3 Hide ignored messages at the soft -> hard buffer layer
This restores normal scrolling behaviour.
2020-09-02 18:51:07 -04:00
C. McEnroe d00b3d3b70 Actually insert blank lines in the soft buffer
So they can be preserved forever!
2020-09-02 16:29:38 -04:00
C. McEnroe 149cafc5ab Render one main window from buffers
Still missing: split scrolling and preserving a blank on reflow either
from resize or ignore toggling.

Anecdata: on one of my instances of catgirl, RAM usage of the previous
release was ~30M, RAM usage of this commit was ~12M.
2020-09-02 00:27:16 -04:00
C. McEnroe 4dc87ab9cd Implement buffer line wrapping
Not yet rendered in the UI! Just done in parallel.
2020-09-01 22:54:26 -04:00
C. McEnroe ded2b6afb6 Factor buffer out of ui
In preparation for doing line wrapping outside of ncurses.
2020-09-01 20:36:50 -04:00
C. McEnroe a98fd70aac Move styleParse out of ui 2020-09-01 18:05:17 -04:00
C. McEnroe 8190d76086 Use a static buffer for base directory paths 2020-08-21 16:49:10 -04:00
C. McEnroe d9a0364cb4 Use configPath to load TLS cert/priv 2020-08-20 14:56:13 -04:00
C. McEnroe f432bd72fa Refactor base dir functions to iterate over paths 2020-08-20 14:08:51 -04:00
C. McEnroe 814c36223a Say "OpenSSL" in additional permission notices
LibreSSL is "a modified version of that library".
2020-08-04 12:19:14 -04:00
C. McEnroe 4c1b1fc6a3 Replace catf with something that tracks len
Also the old catf would be broken with -DNDEBUG oops!
2020-07-30 14:37:46 -04:00
C. McEnroe a142ebcf43 Define explicit_bzero using memset_s on macOS 2020-07-30 13:36:17 -04:00
C. McEnroe 5a3b63e444 Remove use of strlcat
catf is not better though and should really be replaced.
2020-07-30 13:05:24 -04:00
C. McEnroe 94fb9798c5 Bump ParamCap to 254
Apparently IRCds have decided that the 15-parameter limit doesn't matter
anymore. 254 is the maximum number of single-byte parameters (following
a single-byte command) which fit in a 512-byte CR-LF-terminated line.
When everyone decides that the 512-byte line length limit doesn't matter
either, I will delete my software and people can use some JavaScript
garbage instead.

This makes struct Message 2080 bytes, but there's only ever one or two
of them around at once. Avoid passing it by value to handle.
2020-06-24 13:36:24 -04:00
C. McEnroe 721c3a9ee6 Add additional permission for linking with LibreSSL
https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs
2020-06-08 17:48:07 -04:00
Michael Forney bde0f47a70 Mark global variables in chat.h as extern
This fixes the build with gcc 10, which enables -fno-common by
default.
2020-05-07 20:00:33 -04:00
C. McEnroe 73bda18110 Check ignores against id
Otherwise they do not work correctly for QUIT and NICK. This also lets
you ignore private messages only by putting the nick in the third field.
2020-04-07 13:18:42 -04:00
C. McEnroe e3f7362241 Add M-q to collapse whitespace 2020-04-07 10:48:44 -04:00
C. McEnroe 25f419465f Add /ignore message filtering patterns 2020-03-31 14:30:42 -04:00
C. McEnroe a0dde10cb6 Add text macros 2020-03-30 14:56:26 -04:00
C. McEnroe d99f20c0ff Add logging functions
The mkdir dance is a bit awkward...
2020-03-25 18:56:09 -04:00
C. McEnroe 4f40ace9d4 Track MODE in replies 2020-03-23 16:52:24 -04:00
C. McEnroe cf1545870a Assume worst case for unknown user and host in splitMessage
The default USERLEN of 9 doesn't have a great source, the RFC only says
that nicks are length 9, so my assumption is that usernames are not
longer.
2020-03-23 13:25:10 -04:00
C. McEnroe eb6316c235 Track own host, handle CHGHOST 2020-03-22 14:32:20 -04:00
C. McEnroe 8570a62235 Implement the causal.agency/consumer capability 2020-02-29 01:03:46 -05:00
C. McEnroe 3c5e1c95a4 Add /mode, /except, /invex and handle lists replies 2020-02-25 02:12:35 -05:00
C. McEnroe 56de4668ac Add /ban, /unban and handle ban list replies 2020-02-19 21:47:16 -05:00
C. McEnroe b20be7cbad Various small cleanups
Haven't really gone through ui.c yet.
2020-02-16 23:05:43 -05:00
C. McEnroe ba524ed804 Replace a lot of snprintf with a catf implementation 2020-02-16 19:12:19 -05:00