Commit Graph

90 Commits (27b5fd0251276fce156ef066f11086cfba941804)

Author SHA1 Message Date
C. McEnroe fca48fd05d Increment replies for list modes with /mode
Otherwise only /ban can be used to list bans and /mode b or /mode
+b won't show the listing.
2021-10-17 11:55:43 -04:00
Klemens Nanni dfa9a6427f Disable /exec in Kiosk mode (as documented) 2021-07-13 15:16:22 -04:00
C. McEnroe ddb331d8dc Use CS command for paramless /op and /voice
Should match the actual /cs command.
2021-07-13 15:16:22 -04:00
C. McEnroe 44457f85c6 Save invited channel for /join 2021-07-02 15:24:11 -04:00
C. McEnroe a79a3fc9f6 Use NS and CS server aliases
I think I didn't use these originally because they were misconfigured
on tilde.chat, but they work now, and supposedly server aliases
should be more secure/reliable.
2021-06-21 17:26:43 -04:00
C. McEnroe 0d888b88d0 Match windows by substring in /window
This could just iterate over idNames instead, but using complete
means more recently used windows will match first.
2021-06-17 18:52:47 -04:00
Klemens Nanni 9c7ceb23bb /exec without controlling terminal
Otherwise "/exec sh </dev/tty" takes over and catgirl must effectively
be killed to stop the madness;  with this diff:

	catgirl  input| /exec sh </dev/tty
	catgirl output| /bin/sh: cannot open /dev/tty: Device not configured
	catgirl output| Process exits with status 1

Do the same for `-C/Copy', `-N/notify' and `-O/open' alike.
2021-06-13 16:46:34 -04:00
C. McEnroe f559322224 List windows with /window
Reuse the /window command to preserve /wi abbreviation.
2021-05-28 20:40:25 -04:00
C. McEnroe 1deee3c81b Improve missing param behavior for /msg, /whois, /ns, /cs 2021-05-28 15:35:09 -04:00
C. McEnroe cfd5bf213c Set id color from completion in /msg
In the same way that /query copies the id color from completion.
Also make both first check that a color isn't already set.
2021-04-16 16:39:24 -04:00
C. McEnroe 8ea881a097 Show where too-long-messages will be automatically split 2021-03-17 13:34:33 -04:00
C. McEnroe 64d14d3541 Allow multi-line /me and split long /me messages
/me shouldn't behave differently from a regular message.
2021-03-14 17:36:16 -04:00
C. McEnroe d3ab2ff2e7 Fix /help LESS setting for updated manual
The new reference to the COMMANDS section at the beginning of the
manual would get matched instead.
2021-02-08 18:49:39 -05:00
C. McEnroe 9adedc660b Fix /unignore command
Yikes, copy-paste fail.
2021-01-23 16:12:25 -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 063f2aaa0c Add -I highlight option and /highlight 2021-01-16 14:15:00 -05:00
C. McEnroe 5a490945ea Rename ignore code to filter 2021-01-16 13:36:39 -05:00
C. McEnroe 8d57d700a5 Use execl rather than execlp for shell
SHELL is an absolute path.
2021-01-07 13:28:54 -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 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 dce6c11cf6 Allow 2-param form of /whois, count comma-separated nicks
I do not feel like documenting the 2-param form of /whois because it is
weird, but it should work for those who already know about it.
2020-09-18 18:26:13 -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 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 82acea5dfa Add null terminator to modes in channelListMode
Otherwise passing more than 13 parameters reads past the end of the
array.
2020-06-15 20:34:28 -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
C. McEnroe db4af9e7ab Voice, devoice self on /voice, /devoice with no params 2020-04-06 16:30:03 -04:00
C. McEnroe 151739e8da Op, deop self on /op, /deop without params 2020-04-06 16:09:49 -04:00
C. McEnroe 75a6aa9258 Use gnu-case-range and gnu-conditional-omitted-operand extensions
I'm sad to do this but I just can't stand writing (foo ? foo : bar)
anymore.
2020-04-03 17:10:52 -04:00
C. McEnroe 6574f012c9 Only treat /open param as count if single digit 2020-04-03 15:16:49 -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 6bfeff71a2 Add /o alias for /open
I can't live without it.
2020-03-30 11:15:44 -04:00
C. McEnroe ebbb5ad4d2 Add /op, /deop, /voice, /devoice
This collides with using /o for /open which I'm sad about, but I think
these commands should exist...
2020-03-29 12:43:53 -04:00
C. McEnroe 4f40ace9d4 Track MODE in replies 2020-03-23 16:52:24 -04:00
C. McEnroe 35ae4121cb Fix non-multiline command newline handling 2020-03-23 15:47:56 -04:00
C. McEnroe 3cb7cc97f6 Allow commands to take multiline input 2020-03-23 14:54:46 -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 3bb3a11454 Implement message splitting 2020-03-22 15:13:33 -04:00
C. McEnroe be4283b8ff Handle empty input directly in command 2020-03-22 14:38:22 -04:00
C. McEnroe ccde1c2c8c Add /say 2020-03-22 14:19:11 -04:00
C. McEnroe 5c167e4181 Prevent entering commands in <debug> if restricted
Because the <debug> ID always exists, it's possible to create a window
for it even while restricted with "/window <debug>" and try to enter
commands there.
2020-03-02 19:18:55 -05:00
C. McEnroe 3c5e1c95a4 Add /mode, /except, /invex and handle lists replies 2020-02-25 02:12:35 -05:00
C. McEnroe a5cd2cd97a Just use "b" to query ban list 2020-02-20 03:48:26 -05:00
C. McEnroe 56de4668ac Add /ban, /unban and handle ban list replies 2020-02-19 21:47:16 -05:00