~emersion/soju

readme: move to Codeberg
doc: use openssl -verify_quiet instead of discarding stderr

stderr prints useful information when openssl fails to connect to
the server. Use -verify_quiet to reduce chatter a bit and still
retain error messages.
downstream: fix WHO membership prefix order without server-specific flags

Gregory noticed that my last-minute edit was wrong [1]. Indeed,
when i == -1, that means that Flags only contains 'H'/'G'/'*' and
nothing else. We need to append the membership prefix in that case.

[1]: https://lists.sr.ht/~emersion/soju-dev/%3C20240630213249.13061-2-greg@gpanders.com%3E#%3CD2DP18U4PP40.DBYWGA8WM2KN@gpanders.com%3E

Fixes: ae203388e17c ("Fix channel membership prefixes in cached WHO replies")
Reported-by: Gregory Anders <greg@gpanders.com>
Fix channel membership prefixes in cached WHO replies

Channel membership prefixes in WHO replies (RPL_WHOREPLY and
RPL_WHOSPCRPL) were cached in the user's flags, which meant those same
prefixes were returned on future cache hits, even though the flags are
channel specific.

Strip the channel membership prefixes from the user's flags before
adding a user to the cache and add the prefixes back when reading from
the cache (using the membership info from the NAMES reply).
xirc: fix chunking in GenerateSASL

The SASL response needs to be encoded into base64, then split into
400 byte chunks. We were doing it in reverse order.
Set IRC, WS and HTTP Unix sockets' mode to 775

It was 755 before, so a reverse proxy running as a different user didn't
have permission to connect.
doc: document username argument for "user status"
75a58cc2 — delthas 4 months ago
service: user status: accept username filter

This is useful for getting information about a particular user,
especially when the server has more than the max amount of users
returned by the command.
Upgrade dependencies
Remove RLIMIT_NOFILE bump

Starting with Go 1.19 [0] the file limit is increased by default.

[0]: https://github.com/golang/go/commit/8427429c592588af8c49522c76b3e0e0e335d270
0ecc9cd0 — jacob1 5 months ago
Include prefix in CAP messages again

Buggy clients like hexchat can't parse CAP otherwise, making it unable to connect at all. Prefix on CAP commands must be pretty ubiquitous if a major issue like that was never caught
Drop source prefix from most non-numeric server messages

Clients are supposed to handle these just fine without a source
prefix.
Drop unnecessary prefixes for numerics

Previous commit populates the source prefix automatically for all
numerics. Drop the now-unnecessary explicit source prefix.
downstream: ensure numerics always carry a source prefix

From [1]:

> Distinct from a normal message, a numeric reply MUST contain a
> <source> and use a three-digit numeric as the command.

[1]: https://modern.ircdocs.horse/#numeric-replies
downstream: shallow copy message in SendMessage instead of deep copy
fbcda7b9 — jacob1 5 months ago
Fix missing prefix on away numerics

This fixes for example, being unable to use /back after going /away in hexchat. Hexchat is unable to parse the 305/306 numerics without the prefix, so assumes you aren't away, and doesn't let you run /back
upstream: fix panic on malformed RPL_CHANNELMODEIS
fileupload: fix http-origin pattern matching

Mirror what github.com/nhooyr/websocket does and match the host
only. Using the full URL never results in a match, because it
contains slash characters.
Add unix domain socket listeners for HTTP and WS
Automatically join a stored channel on INVITE

Some channels are typically protected with a legacy bot to which
a message is sent, causing the bot to send an INVITE to a channel,
which is invite-only.

Previously, a connect-command for sending a custom message to the
bot could be added, but there was no way to automatically accept
the invite.

This commit enables soju to automatically join a previously saved
channel when we receive an invite to it.

Examples:
- Joining #restricted, then getting disconnected from the upstream,
  sending a message to the bot, receiving an invite and accepting it
- Joining #watercooler, getting kicked, then invited again after a
  while

We eat the INVITE event so that we just transparently join the
channel without warning all downstreams.

Of course, of note is that we do *not* accept invites of
unknown/unsaved channels.

Thanks to eju for finding the issue and providing a first patch.
Next