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
More plumbing needed to make sure we don't block too long waiting
for the reply.
git-svn-id: file:///srv/svn/repo/suika/trunk@679 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This prevents this function from blocking forever if it exceeds the
deadline.
git-svn-id: file:///srv/svn/repo/suika/trunk@678 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Type-A modes always have an argument[0], but soju doesn't care about
them since it doesn't keep track of mode lists (ban/invite/.. lists).
[0] https://modern.ircdocs.horse/#mode-message
> Type A: Modes that add or remove an address to or from a list. These
> modes MUST always have a parameter when sent from the server to a
> client.
git-svn-id: file:///srv/svn/repo/suika/trunk@673 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
VARCHAR(n) is pointless in SQLite and is the same as TEXT. Don't
bother with a migration since they're equivalent.
Also remove some unnecessary DEFAULT NULL statements.
git-svn-id: file:///srv/svn/repo/suika/trunk@663 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
Some clients (Hexchat) always expect AUTHENTICATE * to succeed with
ERR_SASLABORTED even if SASL hasn't been started.
git-svn-id: file:///srv/svn/repo/suika/trunk@653 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This is a mecanical change, which just lifts up the context.TODO()
calls from inside the DB implementations to the callers.
Future work involves properly wiring up the contexts when it makes
sense.
git-svn-id: file:///srv/svn/repo/suika/trunk@652 f0ae65fe-ee39-954e-97ec-027ff2717ef4
downstreamConn.handleMessageUnregistered is only called when the
user isn't registered.
git-svn-id: file:///srv/svn/repo/suika/trunk@647 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This breaks ASCII art. Instead, just drop the final newline if any.
git-svn-id: file:///srv/svn/repo/suika/trunk@637 f0ae65fe-ee39-954e-97ec-027ff2717ef4