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
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
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.
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.
The standard library doesn't distribute connections to different
hosts. This causes issues for large deployments: the bouncer always
connects to the same IRC server, even if an IRC network has multiple
servers.
This is disabled when per-user IPs are disabled, because our resolver
implementation is very bare-bones and e.g. doesn't fallback to IPv4
when IPv6 is unavailable. Per-user IPs indicate a larger deployment
and thus a need to spread the load.
Closes: https://todo.sr.ht/~emersion/soju/221
If the source filename contains special characters like "%", we
would return them as-is in the final URL, and try to parse them as
a URL encoded escape sequence in the GET request.
When started without specifying a fileupload backend, soju crashes
because of a nil-pointer deref.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9484bd]
goroutine 1 [running]:
main.loadConfig()
git.sr.ht/~emersion/soju/cmd/soju/main.go:94 +0x51d
main.main()
git.sr.ht/~emersion/soju/cmd/soju/main.go:127 +0x165
panic: runtime error: invalid memory address or nil pointer dereference
Add a guardclause preventing that crash.
Signed-off-by: Moritz Poldrack <git@moritz.sh>