Commit Graph

156 Commits (4e8ba236b606d53f5cf4688d977ac3c4196c690b)

Author SHA1 Message Date
June McEnroe 073cebec7a Factor out input handling to input.c 2022-02-19 20:20:19 -05:00
June McEnroe 3359a5d69b Factor out window management to window.c 2022-02-19 18:28:45 -05:00
June McEnroe 397b4ce6bd Prompt for empty server or SASL passwords 2022-02-12 13:26:38 -05:00
June McEnroe 605f889ab5 Avoid sending null byte in SASL PLAIN
Woops! BASE64_SIZE is the size of the string buffer. Somehow ergo
is the only server software (that I know of) to reject the accidental
null byte.

Reported by smlavine.
2022-01-16 14:17:46 -05:00
June McEnroe e7cec13723 Use Cold for away notices in queries
So that they can be hidden with M-+.
2022-01-16 14:17:03 -05:00
C. McEnroe bd3e0ac76b Make the /ops response more flavourful
How did this normal sounding format string get in there!
2021-11-16 14:16:43 -05:00
C. McEnroe d06ac675c6 Handle RPL_WHOISSPECIAL
<https://modern.ircdocs.horse/index.html#rplwhoisspecial-320>
2021-11-10 20:31:27 -05:00
psykose 27b5fd0251 Fix strptime decode for musl libc
POSIX does not define a %F for strptime[1], but does define %F for
strftime[2]. Afaik most libc's implement %F for both, but musl is very
standards-compliant and does not have %F on strptime, leading to
unparsed message tag times, which causes all backlog sent from bouncer
on startup to have a timestamp of the current time, instead of the
actual timestamp sent.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html
2021-10-26 12:27:54 -04:00
C. McEnroe 506c5ad906 Correct handling of colons in SASL PLAIN
Only the first colon should be replaced with a null byte.

Ported from pounce.
2021-09-09 12:44:01 -04:00
C. McEnroe 44457f85c6 Save invited channel for /join 2021-07-02 15:24:11 -04:00
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