Clients aren't supposed to do this, but in case they do, let's
send them an error.
git-svn-id: file:///srv/svn/repo/suika/trunk@742 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This adds support for the draft/account-registration extension [1].
This allows downstreams to register on upstream networks.
[1]: https://ircv3.net/specs/extensions/account-registration
git-svn-id: file:///srv/svn/repo/suika/trunk@729 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This will stop clients from trying to issue AUTHENTICATE requests
after connection registration.
git-svn-id: file:///srv/svn/repo/suika/trunk@725 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Once the downstream connection has logged in with their bouncer
credentials, allow them to issue more SASL auths which will be
redirected to the upstream network. This allows downstream clients
to provide UIs to login to transparently login to upstream networks.
git-svn-id: file:///srv/svn/repo/suika/trunk@724 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This will allow clients to properly show/hide UI to login and
register.
git-svn-id: file:///srv/svn/repo/suika/trunk@722 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Implements the following recommendation from the spec:
> If the client completes registration (with CAP END, NICK, USER and any other
> necessary messages) while the SASL authentication is still in progress, the
> server SHOULD abort it and send a 906 numeric, then register the client
> without authentication.
git-svn-id: file:///srv/svn/repo/suika/trunk@721 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This patch adds a bit more compliance to the chathistory IRCv3 specification.
git-svn-id: file:///srv/svn/repo/suika/trunk@719 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Now that dc.nick is not blank during registration, sasl replies from the
server are correct and cap handling can be a bit simplified.
git-svn-id: file:///srv/svn/repo/suika/trunk@716 f0ae65fe-ee39-954e-97ec-027ff2717ef4
The MOTD indicates the end of the registration's message burst, and
the server can send arbitrary messages before it.
Update the supported capabilities, the nick and the realname before
MOTD to make it so client logic that runs on MOTD can work with
up-to-date info.
git-svn-id: file:///srv/svn/repo/suika/trunk@706 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This function wraps a parent context, and returns a new context
cancelled when the connection is closed. This will make it so
operations started from downstreamConn.handleMessage will be
cancelled when the connection is closed.
git-svn-id: file:///srv/svn/repo/suika/trunk@703 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Should still be more than enough to connect even if the network is
somewhat flaky.
git-svn-id: file:///srv/svn/repo/suika/trunk@699 f0ae65fe-ee39-954e-97ec-027ff2717ef4
As a bonus, the timeout now applies to the whole TLS dial
operation. Before the timeout only applied to the net dial
operation, making it possible for a bad server to stall the request
by making the TLS handshake extremely slow.
git-svn-id: file:///srv/svn/repo/suika/trunk@698 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This will make it easier to globally disable multi-upstream mode.
git-svn-id: file:///srv/svn/repo/suika/trunk@693 f0ae65fe-ee39-954e-97ec-027ff2717ef4
When on an unbound bouncer network downstream, we should return no
targets (there are none, because there are no upstreams at all).
When on a multi-upstream downstream, we should return no targets as we
don't support multi-upstream CHATHISTORY TARGETS.
Before this patch, we returned a misleading error message:
:example.com 403 :Missing network suffix in name
git-svn-id: file:///srv/svn/repo/suika/trunk@688 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If a downstream of prefix host `foo` sends a message, the other
downstream of prefix host `bar` should receive an echo PRIVMSG with
prefix host bar.
This fixes a regression where no prefix host was sent at all.
git-svn-id: file:///srv/svn/repo/suika/trunk@686 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Add support for MONITOR in single-upstream mode.
Each downstream has its own set of monitored targets. These sets
are merged together to compute the MONITOR commands to send to
upstream.
Each upstream has a set of monitored targets accepted by the server
alongside with their status (online/offline). This is used to
directly send replies to downstreams adding a target another
downstream has already added, and send MONITOR S[TATUS] replies.
Co-authored-by: delthas <delthas@dille.cc>
git-svn-id: file:///srv/svn/repo/suika/trunk@684 f0ae65fe-ee39-954e-97ec-027ff2717ef4
We just forward the command as-is, so we can pass down the ISUPPORT
token as well.
Closes: https://todo.sr.ht/~emersion/soju/148
git-svn-id: file:///srv/svn/repo/suika/trunk@683 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This has the following upsides:
- We can now routes WHO replies to the correct client, without
broadcasting them to everybody.
- We are less likely to hit server rate limits when multiple downstreams
are issuing WHO commands at the same time.
git-svn-id: file:///srv/svn/repo/suika/trunk@682 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Multi-upstream connections can still send LIST commands with a
network suffix.
git-svn-id: file:///srv/svn/repo/suika/trunk@681 f0ae65fe-ee39-954e-97ec-027ff2717ef4
The message stores don't need to access the internal network
struct, they just need network metadata such as ID and name.
This can ease moving message stores into a separate package in the
future.
git-svn-id: file:///srv/svn/repo/suika/trunk@666 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Make Network.Nick optional, default to the user's username. This
will allow adding a global setting to set the nickname in the
future, just like we have for the real name.
References: https://todo.sr.ht/~emersion/soju/110
git-svn-id: file:///srv/svn/repo/suika/trunk@664 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This adds support for WHOX, without bothering about flags and mask2
because Solanum and Ergo [1] don't support it either.
The motivation is to allow clients to reliably query account names.
It's not possible to use WHOX tokens to route replies to the right
client, because RPL_ENDOFWHO doesn't contain it.
[1]: https://github.com/ergochat/ergo/pull/1184
Closes: https://todo.sr.ht/~emersion/soju/135
git-svn-id: file:///srv/svn/repo/suika/trunk@660 f0ae65fe-ee39-954e-97ec-027ff2717ef4
@ and + indicate channel privileges. * indicates that the user is
a server operator.
git-svn-id: file:///srv/svn/repo/suika/trunk@659 f0ae65fe-ee39-954e-97ec-027ff2717ef4
That's what some widely used IRC servers do for their own services
(e.g. NickServ and ChanServ). This adds an additional level of
trust to make sure BouncerServ isn't typo'ed or impersonated.
git-svn-id: file:///srv/svn/repo/suika/trunk@657 f0ae65fe-ee39-954e-97ec-027ff2717ef4