Commit Graph

146 Commits (54251acae34fe7d72f1f93a69158fbe16cc8a30e)

Author SHA1 Message Date
C. McEnroe e2bebca7dc Handle "\1ACTION\1" empty actions 2021-06-20 19:22:20 -04:00
C. McEnroe da374e6e61 Don't match actions in notices 2021-06-20 18:17:38 -04:00
C. McEnroe a5a225c52c Add -m mode option to set user modes 2021-06-18 12:28:09 -04:00
C. McEnroe d3b2f86a4b Handle 338 as whois reply
Used by Solanum for "actually using host".
2021-06-17 20:18:37 -04:00
C. McEnroe 2dcadaf260 Reset formatting after realname in setname
Missed this one.
2021-06-12 10:35:53 -04:00
C. McEnroe 7e4fa80c96 Avoid trailing comma in whois channels lists
The format of the reply is defined as "<nick> :{[@|+]<channel><space>}".
2021-06-10 19:38:12 -04:00
C. McEnroe e066a954f5 Replace catf with seprintf 2021-06-09 11:56:35 -04:00
Klemens Nanni 868c604a55 Use reverse video not colors for topic change when disabled
`-H 0,0`/"hash = 0,0" makes catgirl mostly colorless which is great,
but topic changes still hardcode brown/green colors to show differences
which is usually not desired by users (like me) disabling colors.

Go for a less eye stressing topic change message that shows both old
and new in reverse video with default terminal colors.

This isn't perfect, other parts of catgirl still hardcode colors and
`-H 0,0`/"hash = 0,0" was never meant to disable colors completely, but
topics change often enough that avoiding less readable^Waccessible topic
diffs seems sensible enough.

NB: parseHash() is brittle and "0,0" is not the only value disabling
colors...
2021-05-25 16:11:31 -04:00
Klemens Nanni f9a36441e0 Use color enum instead of hardcoded value 2021-05-25 14:33:08 -04:00
C. McEnroe 7bacf63d9e Don't require 4 parameters to ERR_USERONCHANNEL
It should have 4, but the handler only uses 3.
2021-05-20 16:38:22 -04:00
C. McEnroe 94f79e889f Reset formatting after realnames 2021-04-27 21:06:16 -04:00
C. McEnroe 63bffae8c1 Always show 341 RPL_INVITING
At least in InspIRCd's implementation, you only get invite-notify
INVITEs if you are op, so inviting with no op (where allowed by a
channel mode) results in only a 341. On the other hand, inviting
as an op produces both a 341 and an INVITE, so will be displayed
twice, but showing something sometimes twice is better than not
showing it at all.
2021-04-16 16:39:24 -04:00
C. McEnroe df6bc07f44 Skip STATUSMSG prefixes
This feature is rarely used, so just skip STATUSMSG prefixes in the
target so messages get routed correctly.
2021-04-02 17:26:43 -04:00
C. McEnroe 761979d33e Use separate reply counts for automatic join topics/names
This restores showing the topic and names for automatic joined
channels, while still avoiding touching the windows, by using Cold
heat.
2021-02-21 14:23:17 -05:00
C. McEnroe 180287164c Only treat a single -j join as explicit
In other words, only automatically switch to an automatically joined
channel window if there's only one. Otherwise, stay on the <network>
window and avoid touching the channel windows with their automatic
topic and names replies.

This fixes unintentionally clearing saved window unread counts when
rejoining channels automatically by switching to them as they are
joined.
2021-02-04 21:25:59 -05:00
C. McEnroe 75b0c02227 Add 335 to WHOIS responses
This is used by InspIRCd to indicate if a user is a bot (if it set
user mode +B).
2021-01-28 15:31:00 -05:00
C. McEnroe 6cab788e6a Use Warm heat for replies to user-initiated commands
Otherwise they are invisible with M-+ and commands having no output
is confusing.
2021-01-26 17:24:05 -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 763802cae6 Don't pass nick to urlScan for MOTD and help 2021-01-11 17:59:12 -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 b4ed58602b Handle so-called Standard Replies 2020-12-29 23:11:57 -05:00
C. McEnroe 997c932e83 Handle 437 ERR_UNAVAILRESOURCE like ERR_NICKNAMEINUSE
Not totally clear under what conditions 437 is returned, but if it
happens during registration, we should pick a new nick.
2020-12-05 23:06:45 -05:00
C. McEnroe ded0455d3e Remove static buffer from colorMentions 2020-11-08 15:16:25 -05:00
C. McEnroe a8264f31e0 Remove static buffer from capList 2020-11-08 15:07:13 -05:00
C. McEnroe a0abd6582e Highlight changed portion of topic
"%.*ls" is useless.
2020-11-08 12:42:01 -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 2b8a45779d Switch back to checking for server by nick with '.'
This fixes a bug where if you send a private message before joining any
channels, your message will be routed to the <network> window. That
happens because without a JOIN, self.user remains unset, which means
that require will copy self.nick (set by echoMessage) to self.host. The
easiest solution is to go back to checking for '.' and add a '.' to the
default nick, so now if a server sends a NOTICE with no origin it will
look like -*.*- which is kinda cute.
2020-09-18 18:13:09 -04:00
C. McEnroe e229931253 Don't call completeTouch for ignored messages 2020-09-02 17:51:51 -04:00
C. McEnroe b06470294d Match mentions case-sensitively
The mention coloring code already matches case-sensitively, and any
proper ping should be using tab-complete anyway so there's no reason for
differing case. And the month of June should not ping me.
2020-08-18 21:26:17 -04:00
C. McEnroe 10e953b8b5 Set origin fields to "*" if missing
Also determine if a message is from the server by if the host field has
been copied from the nick field.

EFNet sends NOTICEs with no origin during registration.

RFC 1459 has this to say:

> If the prefix is missing from the message, it is assumed to have
> originated from the connection from which it was received.

I suppose a more correct implementation would be to set the origin to
the hostname of the server, but we don't store that globally, so this
is good enough.
2020-08-16 22:52:01 -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 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 3e03b7502b Add current topic to tab-complete so it can edited 2020-07-13 10:22:33 -04:00
C. McEnroe e6db22d2bb Don't scan ignored messages for URLs 2020-07-09 22:43:35 -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 4fb94a1a22 Color mentions up to first ": " rather than just ":"
Avoids coloring everything up to a ":)".
2020-06-16 23:14:07 -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 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 1969c9125f Error on missing MODE parameters 2020-04-05 13:17:38 -04:00
C. McEnroe bb531a71b1 Error on invalid ISUPPORT values 2020-04-05 13:11:19 -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 25f419465f Add /ignore message filtering patterns 2020-03-31 14:30:42 -04:00
C. McEnroe ff78362826 Replace some declaration; while loops with for loops
I should have been using this for getopt loops already but the call here
is slightly too long to fit on one line as a for loop.
2020-03-30 19:44:45 -04:00