111 Commits

Author SHA1 Message Date
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
C. McEnroe
bb2f3c7a01 Rewrite mode formatting again and write to log
Going back to one line per mode change again because it's easier.
2020-03-28 12:08:10 -04:00
C. McEnroe
3dc998272e Log chat events
Still missing is logging MODE changes, which will be hell, unless it
just logs the raw stuff.
2020-03-25 18:58:48 -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
0d0a6d1575 Handle RPL_CHANNELMODEIS 2020-03-22 11:40:58 -04:00
C. McEnroe
61828a12e9 Handle user mode changes 2020-03-22 11:26:16 -04:00
C. McEnroe
8da45d9183 Rewrite handleMode 2020-03-22 11:18:21 -04:00
C. McEnroe
1c508b78ab Handle RPL_UMODEIS 2020-03-18 08:33:42 -04:00
C. McEnroe
2f53f75892 Ignore 422 ERR_NOMOTD
pounce will start sending these because some silly clients don't think
they're connected until some MOTD reply...
2020-03-09 03:08:59 -04:00
C. McEnroe
7e120f00a1 Set self.pos before handling the message
This intuitively feels wrong, but isn't. Most importantly, handleError
immediately exits, but we still need to "consume" that message,
otherwise pounce will keep sending it on reconnect. The same goes for
any other handler that might cause an exit, such as a require parameter
count failure.
2020-03-08 23:15:56 -04:00
C. McEnroe
8570a62235 Implement the causal.agency/consumer capability 2020-02-29 01:03:46 -05:00
C. McEnroe
78b4832bfe Add raw modes to mode message 2020-02-25 03:00:36 -05:00
C. McEnroe
e9524b4af3 Handle changing setParamModes, paramModes and other channel modes 2020-02-25 02:54:15 -05:00
C. McEnroe
431945614d Fix handling EXCEPTS and INVEX without values 2020-02-25 02:24:29 -05:00
C. McEnroe
3c5e1c95a4 Add /mode, /except, /invex and handle lists replies 2020-02-25 02:12:35 -05:00
C. McEnroe
c3c40d738b Accumulate mode changes into a buffer for one message 2020-02-23 22:44:19 -05:00
C. McEnroe
9609723dc6 Handle ERR_CHANOPRIVSNEEDED 2020-02-20 05:04:58 -05:00
C. McEnroe
50a6d34a55 Handle MODE changing channel list modes 2020-02-20 04:53:06 -05:00
C. McEnroe
c2c8595012 Handle MODE setting channel prefix modes 2020-02-20 04:18:25 -05:00
C. McEnroe
a3b6d5d9a7 Change ban list formatting 2020-02-20 03:44:57 -05:00
C. McEnroe
b3c5458fc9 Rearrange some handlers 2020-02-20 03:18:48 -05:00
C. McEnroe
42ad42887c Handle RPL_INVITING when no invite-notify 2020-02-20 02:32:36 -05:00
C. McEnroe
5c79b16a51 Handle ERR_BANLISTFULL 2020-02-20 02:13:23 -05:00
C. McEnroe
1b01045bf0 Add handlers for user-in-channel errors 2020-02-20 01:52:58 -05:00
C. McEnroe
f494fe6edb Add generic error reply handler
This should have been in way earlier...
2020-02-20 01:38:31 -05:00
C. McEnroe
56de4668ac Add /ban, /unban and handle ban list replies 2020-02-19 21:47:16 -05:00
C. McEnroe
2a33ee68dd Format WHOIS signon date with %F %T 2020-02-19 21:29:51 -05:00
C. McEnroe
ba524ed804 Replace a lot of snprintf with a catf implementation 2020-02-16 19:12:19 -05:00
C. McEnroe
3885dd5231 Add 379 to WHOIS responses 2020-02-16 18:42:38 -05:00
C. McEnroe
edd8855418 Track EXCEPTS and INVEX modes 2020-02-16 18:31:50 -05:00
C. McEnroe
f84ab67311 Apply colorMentions to actions
The first-two-words branch works well for "/me verbs nick".
2020-02-16 05:22:28 -05:00
C. McEnroe
700b5d5870 Replace small integers in size_t with uint 2020-02-15 22:19:55 -05:00
C. McEnroe
83df94b359 Still add nick without prefixes to complete 2020-02-15 22:19:05 -05:00
C. McEnroe
9b1ab69908 Track PREFIX modes and CHANMODES 2020-02-15 05:29:54 -05:00