summary refs log tree commit diff
path: root/chat.h (follow)
Commit message (Collapse)AuthorAge
* Match id names case-insensitivelyJune McEnroe2021-08-26
| | | | | | | | | | | | | | This fixes the case where an IRCd does not normalize channel names, e.g. PRIVMSG #TEST is relayed as-is, rather than as #test or whatever the canonical casing of the channel name is. It also fixes the case of opening a query window with incorrect case, e.g. /query nickserv. However, this solution is only completely correct when CASEMAPPING=ascii.[1] I do not think the extra mappings of CASEMAPPING=rfc1459 are relevant enough to justify adding the code to handle it. [1]: https://modern.ircdocs.horse/#casemapping-parameter
* Add -q/quiet option to raise default message visibility thresholdKlemens Nanni2021-07-20
| | | | | | | | | | | Silencing all windows with `M-+' (across multiple catgirl instances) can be cumbersome, so provide an option to hide events, JOIN/PART noise, etc. by default (each window's threshold will persist across load/save cycles, i.e. when using the `-s/save' option). Started out as `-v | visibility = threshold' to set a specific level, the idea of a simpler toggle comes from june, who also squashed other bugs (as usual).
* Perform TLS handshake after final pledgeKlemens Nanni2021-07-13
| | | | | | | | | | | | | | | | | ircConnect() yields a connected TCP socket after which "inet dns" is no longer needed. Possibly having loaded private key material, it seems a tad more comforting to speak TLS *after* dropping any network capabilities (except for socket read/write to the IRC host, of course). Instead of moving the final pledge into irc.c:ircConnect() and thus complicating the code around pledge across two C modules, simply stub out an mnemonic ircHandshake() and call that explicitly. This restores behaviour gained with 981ebc4 "Remove explicit tls_handshake(3) from ircConnect" which was reverted for other reasons.
* Save invited channel for /joinJune McEnroe2021-07-02
|
* Keep log directory open, use mkdirat(2) and openat(2)June McEnroe2021-06-25
|
* OpenBSD: Only unveil used directoriesKlemens Nanni2021-06-20
| | | | | | dataMkdir() already picked the appropiate directory so make it return that such that unveilData() can go as only that one directory needs unveiling.
* Add -m mode option to set user modesJune McEnroe2021-06-18
|
* Match windows by substring in /windowJune McEnroe2021-06-17
| | | | | This could just iterate over idNames instead, but using complete means more recently used windows will match first.
* Open save file once in uiLoad() and keep it open until uiSave()Klemens Nanni2021-06-11
| | | | | | | | | | | | | | | | | Opening the same file *path* twice is a TOCTOU, although not a critical one: worst case we load from one file and save to another - the impact depends on how and when catgirl is started the next anyway. More importantly, keeping the file handle open at runtime allows us to drop all filesystem related promises for `-s/save' on OpenBSD. uiLoad() now opens "r+", meaning "Open for reading and writing." up front so uiSave() can write to it. In the case of a nonexistent save file, it now opens with "w" meaning "Open for writing. The file is created if it does not exist.", i.e. the same write/create semantics as "w" except uiLoad() no longer truncates. existing files. uiSave() now truncates the save file to avoid appending in general.
* Avoid creating out-of-bounds pointer when checking for seprintf truncationMichael Forney2021-06-09
| | | | | | | It is technically undefined behavior (see C11 6.5.6p8) to construct a pointer more than one past the end of an array. To prevent this, compare n with the remaining space in the array before adding to ptr.
* Remove catfJune McEnroe2021-06-09
|
* Replace catf with seprintfJune McEnroe2021-06-09
|
* Add seprintfJune McEnroe2021-06-09
| | | | | | | | | Based on seprint(2) from Plan 9. I'm not sure if my return value exactly matches Plan 9's in the case of truncation. seprint(2) is described only as returning a pointer to the terminating '\0', but if it does so even in the case of truncation, it is awkward for the caller to detect. This implementation returns end in the truncation case, so that (ptr == end) indicates truncation.
* List windows with /window 1.8June McEnroe2021-05-28
| | | | Reuse the /window command to preserve /wi abbreviation.
* Hash the username in kiosk modeJune McEnroe2021-05-27
| | | | So that the first part of $SSH_CLIENT can be passed as username.
* Ignore messages in reply to previously ignored messagesJune McEnroe2021-05-04
| | | | | | | | Using the +draft/reply client tag, which is supported by BitBot. This hides the bot's replies to ignored users or ignored bot command messages. This commit is dedicated to the land of Estonia.
* Skip STATUSMSG prefixesJune McEnroe2021-04-02
| | | | | This feature is rarely used, so just skip STATUSMSG prefixes in the target so messages get routed correctly.
* Show where too-long-messages will be automatically splitJune McEnroe2021-03-17
|
* Disable nick and channel colors with hash bound 0June McEnroe2021-03-08
|
* Use separate reply counts for automatic join topics/namesJune McEnroe2021-02-21
| | | | | | This restores showing the topic and names for automatic joined channels, while still avoiding touching the windows, by using Cold heat.
* Measure timestamp width using ncursesJune McEnroe2021-01-27
| | | | | This allows for non-ASCII characters in timestamps, and simplifies things by including the trailing space in the width.
* Add toggleable display of timestampsJune McEnroe2021-01-27
|
* Add numbers to buffer linesJune McEnroe2021-01-26
| | | | | | | | | 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.
* Separate kiosk mode from restrict modeJune McEnroe2021-01-23
| | | | | | | | | | | 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.
* Rename ignore code to filterJune McEnroe2021-01-16
|
* Generalize ignore toggling to visibility thresholdJune McEnroe2021-01-16
|
* Save and load the URL ring in the save file 1.4June McEnroe2021-01-11
|
* Print chain to stdout with -oJune McEnroe2021-01-10
|
* Add -o and -t options to trust self-signed certificatesJune McEnroe2021-01-09
|
* Allow configuring the upper bound of the hash functionJune McEnroe2021-01-09
| | | | | | | 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?
* Split ignore fields to avoid over-eager * matchingJune McEnroe2021-01-01
| | | | | | | | | | 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.
* Factor out reply count checking and decrementingJune McEnroe2020-12-30
|
* Add /whowasJune McEnroe2020-12-30
|
* Show setnames like nick changesJune McEnroe2020-12-30
|
* Add /setname commandJune McEnroe2020-12-29
| | | | | | I'm not sure about that replies check in handleStandardReply. If more of those are added the reply counter system will definitely need refactoring.
* Avoid eating C-c while connectingJune McEnroe2020-10-12
| | | | | Split UI initialization into two steps either side of the call to connect, so that C-c works as interrupt while it's blocked.
* Factor out styleStripJune McEnroe2020-10-09
|
* Double up /help for server helpJune McEnroe2020-10-02
| | | | | | 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.
* Use WHO for /opsJune McEnroe2020-09-30
| | | | Accumulate names in a buffer and show away status.
* Add /ops commandJune McEnroe2020-09-30
| | | | | | 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.
* Recalculate unreadHard on reflowJune McEnroe2020-09-02
|
* Hide ignored messages at the soft -> hard buffer layerJune McEnroe2020-09-02
| | | | This restores normal scrolling behaviour.
* Actually insert blank lines in the soft bufferJune McEnroe2020-09-02
| | | | So they can be preserved forever!
* Render one main window from buffersJune McEnroe2020-09-02
| | | | | | | | 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.
* Implement buffer line wrappingJune McEnroe2020-09-01
| | | | Not yet rendered in the UI! Just done in parallel.
* Factor buffer out of uiJune McEnroe2020-09-01
| | | | In preparation for doing line wrapping outside of ncurses.
* Move styleParse out of uiJune McEnroe2020-09-01
|
* Use a static buffer for base directory pathsJune McEnroe2020-08-21
|
* Use configPath to load TLS cert/privJune McEnroe2020-08-20
|
* Refactor base dir functions to iterate over pathsJune McEnroe2020-08-20
|