273 Commits

Author SHA1 Message Date
contact
c5665ceb4a Add support for WHOX
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
2021-11-02 17:25:43 +00:00
contact
956263f0f3 Fix operator flag in RPL_WHOREPLY
@ 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
2021-11-01 17:36:21 +00:00
contact
0b3d82d359 Mark admins as server operators in self WHO/WHOIS replies
git-svn-id: file:///srv/svn/repo/suika/trunk@658 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-01 17:32:01 +00:00
contact
a80cf22771 Mark BouncerServ as server operator
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
2021-11-01 17:28:19 +00:00
contact
ba0f309c71 Get rid of io.EOF errors in logs
Closes: https://todo.sr.ht/~emersion/soju/150

git-svn-id: file:///srv/svn/repo/suika/trunk@655 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-29 14:03:04 +00:00
contact
8094bb5252 Unify BOUNCER ADDNETWORK and CHANGENETWORK
git-svn-id: file:///srv/svn/repo/suika/trunk@654 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-29 13:51:13 +00:00
contact
897ad293e6 Always reply ERR_SASLABORTED on SASL abort
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
2021-10-28 09:29:34 +00:00
contact
2748715183 Add context args to Database interface
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
2021-10-18 17:15:15 +00:00
contact
9455e04afb Remove unnecessary downstream cap checks
downstreamConn.SendMessage already performs this cap checking.

git-svn-id: file:///srv/svn/repo/suika/trunk@651 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-18 07:20:11 +00:00
contact
2a475dc7fa Remove incorrect AWAY TODO in downstreamConn.SendMessage
PRIVMSG/NOTICE get RPL_AWAY, not AWAY.

git-svn-id: file:///srv/svn/repo/suika/trunk@650 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-18 07:08:52 +00:00
contact
7ed749a0c2 Unify away-notify and account-notify handling
git-svn-id: file:///srv/svn/repo/suika/trunk@649 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-17 19:54:18 +00:00
contact
cbf11ae498 Add support for account-notify
git-svn-id: file:///srv/svn/repo/suika/trunk@648 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-17 19:54:18 +00:00
contact
d98ecb5722 Remove unused REGISTRATION_IS_COMPLETED in handleMessageUnregistered
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
2021-10-16 09:42:32 +00:00
contact
02449246d7 Send BOUNCER REGISTRATION_IS_COMPLETED error
git-svn-id: file:///srv/svn/repo/suika/trunk@646 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-16 09:41:37 +00:00
yyp
e54608a2cc downstream: handle name=... in BOUNCER
git-svn-id: file:///srv/svn/repo/suika/trunk@641 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-14 14:03:14 +00:00
contact
afd52fc4c3 Add bouncer MOTD
Closes: https://todo.sr.ht/~emersion/soju/137

git-svn-id: file:///srv/svn/repo/suika/trunk@636 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 08:58:34 +00:00
contact
9d5456fb96 Stop sending RPL_CREATED
There's no point in sending this numeric if it doesn't contain any
useful info.

git-svn-id: file:///srv/svn/repo/suika/trunk@629 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 17:28:44 +00:00
contact
627f9f74a7 Fix printf formatting in error message
git-svn-id: file:///srv/svn/repo/suika/trunk@627 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 15:36:00 +00:00
hubert
75c35762b2 Correctly send back PRIVMSGs and NOTICEs to self
git-svn-id: file:///srv/svn/repo/suika/trunk@618 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-10 10:05:41 +00:00
hubert
51c6ddf269 Send back TAGMSGs to self
git-svn-id: file:///srv/svn/repo/suika/trunk@617 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-10 10:05:41 +00:00
hubert
83f092720a Dismiss TAGMSGs directed to BouncerServ
git-svn-id: file:///srv/svn/repo/suika/trunk@616 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-10 10:05:40 +00:00
contact
c8179c1537 Add WHOIS reply for BouncerServ
git-svn-id: file:///srv/svn/repo/suika/trunk@609 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-06 09:50:12 +00:00
hubert
d061961130 Allow CAP negotiation to happen with CAP REQ
See https://ircv3.net/specs/extensions/capability-negotiation

> Upon receiving either a CAP LS or CAP REQ command during connection
> registration, the server MUST not complete registration until the
> client sends a CAP END command to indicate that capability negotiation
> has ended.

This commit should prevent soju from trying to authenticate the user
prior to having received AUTHENTICATE messages, when the client eagerly
requests capabilities with CAP REQ seeing available capabilities
beforehand with CAP LS.

git-svn-id: file:///srv/svn/repo/suika/trunk@590 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-19 14:50:47 +00:00
contact
83bfbdca16 Send empty history for service
Fixes error when fetching chat history for BouncerServ.

git-svn-id: file:///srv/svn/repo/suika/trunk@586 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-13 09:36:25 +00:00
contact
b07e704c62 Don't require upstream to be connected for CHATHISTORY
Closes: https://todo.sr.ht/~emersion/soju/127

git-svn-id: file:///srv/svn/repo/suika/trunk@585 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-13 09:25:38 +00:00
contact
710d953e10 Split unmarshalEntity into two functions
Some command handlers need to unmarshal without requiring the
upstream to be connected.

git-svn-id: file:///srv/svn/repo/suika/trunk@584 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-13 09:14:47 +00:00
contact
364c9ca695 Pass-through CLIENTTAGDENY in ISUPPORT
git-svn-id: file:///srv/svn/repo/suika/trunk@580 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-07-09 20:48:58 +00:00
contact
474d6e3ccd Add per-user realname setting
This allows users to set a default realname used if the per-network
realname isn't set.

A new "user update" command is introduced and can be extended to edit
other user properties and other users in the future.

git-svn-id: file:///srv/svn/repo/suika/trunk@568 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-25 18:33:13 +00:00
contact
c781bcfa4c Disallow '$' in nicks
git-svn-id: file:///srv/svn/repo/suika/trunk@565 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-23 17:54:22 +00:00
contact
ae0ac7c6f0 Allow admins to broadcast message to all bouncer users
Typically done via:

    /notice $<bouncer> <message>

Or, for a connection not bound to a specific network:

    /notice $* <message>

The message is broadcast as BouncerServ, because that's the only
user that can be trusted to belong to the bouncer by users. Any
other prefix would conflict with the upstream network.

git-svn-id: file:///srv/svn/repo/suika/trunk@563 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-23 17:23:09 +00:00
contact
a649f4acdf Unify downstream PRIVMSG and NOTICE handling
We were doing some things wrong here, e.g. not sending echo messages
for NOTICE.

git-svn-id: file:///srv/svn/repo/suika/trunk@562 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-23 16:17:30 +00:00
contact
bc5ddaefee Add support for utf8-only
git-svn-id: file:///srv/svn/repo/suika/trunk@560 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-15 13:48:10 +00:00
contact
d0fa8cd516 Add support for account-tag
git-svn-id: file:///srv/svn/repo/suika/trunk@559 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-14 19:44:38 +00:00
contact
17a115d060 Don't suggest users to /motd in multi-upstream mode
git-svn-id: file:///srv/svn/repo/suika/trunk@555 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-10 10:16:33 +00:00
contact
3172dbeb87 Make user MODE commands fail in multi-upstream mode
References: https://todo.sr.ht/~emersion/soju/20

git-svn-id: file:///srv/svn/repo/suika/trunk@554 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-10 09:24:10 +00:00
greg
594bd5bf30 Forward user mode changes in single-upstream mode
References: https://todo.sr.ht/~emersion/soju/20

git-svn-id: file:///srv/svn/repo/suika/trunk@553 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-10 09:17:00 +00:00
greg
be96d9078b Forward MOTD messages downstream
The first MOTD upon connection is ignored, but subsequent MOTD messages
(requested by the "MOTD" message from the client, typically using a
/motd command) are forwarded.

git-svn-id: file:///srv/svn/repo/suika/trunk@552 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-09 19:29:36 +00:00
contact
5fe3eae580 Add downstreamConn.SendBatch helper
git-svn-id: file:///srv/svn/repo/suika/trunk@551 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-05 10:38:52 +00:00
contact
f8859b0d8a Prune detached channels from CHATHISTORY TARGETS
git-svn-id: file:///srv/svn/repo/suika/trunk@550 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-04 09:27:59 +00:00
contact
522becbe30 Implement CHATHISTORY TARGETS
References: https://github.com/ircv3/ircv3-specifications/pull/450

git-svn-id: file:///srv/svn/repo/suika/trunk@549 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-02 18:32:11 +00:00
contact
b9249feca3 Forward unknown commands to upstream in single-upstream mode
git-svn-id: file:///srv/svn/repo/suika/trunk@547 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-28 09:15:15 +00:00
contact
048bea91ce Reject JOIN with invalid channel names
This prevents us from storing typo'ed channel names in the DB.

git-svn-id: file:///srv/svn/repo/suika/trunk@545 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-26 09:23:09 +00:00
contact
30c6e9e954 Allow networks to be disabled
git-svn-id: file:///srv/svn/repo/suika/trunk@542 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-26 08:51:02 +00:00
contact
b4ffea243d Add support for IRCv3 setname
References: https://todo.sr.ht/~emersion/soju/41

git-svn-id: file:///srv/svn/repo/suika/trunk@540 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-25 18:24:45 +00:00
contact
ac62ccdfbc Vendor BATCH bouncer-networks type
And add the prefix throughout the spec, to make it clear the unprefixed
version is not to be used.

git-svn-id: file:///srv/svn/repo/suika/trunk@537 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-25 14:56:38 +00:00
contact
b736ba981b Introduce the soju.im/bouncer-networks-notify capability
git-svn-id: file:///srv/svn/repo/suika/trunk@535 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-25 14:42:51 +00:00
contact
8ceceb932c Send network settings in LISTNETWORKS
git-svn-id: file:///srv/svn/repo/suika/trunk@534 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-25 14:42:51 +00:00
contact
66c64aa42f Add pass to bouncer network attributes
git-svn-id: file:///srv/svn/repo/suika/trunk@533 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-25 14:42:51 +00:00
contact
f00821626a Implement the soju.im/bouncer-networks extension
git-svn-id: file:///srv/svn/repo/suika/trunk@532 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-25 14:42:51 +00:00
philipk
63e19e8add Directly return self-messages to user in multi-upstream mode
git-svn-id: file:///srv/svn/repo/suika/trunk@529 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-24 11:31:24 +00:00