Commit Graph

1131 Commits

Author SHA1 Message Date
Simon Ser
0c360d24c5 Remove support for mixed multi-upstream LIST
Multi-upstream connections can still send LIST commands with a
network suffix.
2021-11-09 21:32:26 +01:00
Simon Ser
d870efa666 Add context support to Server.createUser 2021-11-08 20:29:14 +01:00
Simon Ser
e3b1930bf2 Add partial context support to handleUserUpdate
More plumbing needed to make sure we don't block too long waiting
for the reply.
2021-11-08 19:48:32 +01:00
Simon Ser
22f9ce1b86 Check context cancellation in handleServiceServerNotice
This prevents this function from blocking forever if it exceeds the
deadline.
2021-11-08 19:42:36 +01:00
Simon Ser
802e82c272 Add context support to service
References: https://todo.sr.ht/~emersion/soju/141
2021-11-08 19:40:48 +01:00
Simon Ser
c21202160c Add context support to user and network mutations
References: https://todo.sr.ht/~emersion/soju/141
2021-11-08 19:36:10 +01:00
Simon Ser
8b3e5e7465 Plumb context in downstreamConn.handleMessageRegistered
References: https://todo.sr.ht/~emersion/soju/141
2021-11-08 18:11:24 +01:00
Simon Ser
659083c781 Fix upstream USER command when both username and nick are empty 2021-11-07 18:33:59 +01:00
Hubert Hirtz
7fbaaefc9c Skip list/type A mode arguments
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.
2021-11-04 12:24:15 +01:00
Simon Ser
c2047dc1a8 Add plus sign in RPL_UMODEIS reply 2021-11-03 22:02:19 +01:00
Simon Ser
26cdb0d328 Set mode +o on admins for bouncer-only connections 2021-11-03 21:42:42 +01:00
Simon Ser
abe5f362db Turn CHATHISTORY and backlog limits into constants 2021-11-03 18:29:21 +01:00
Simon Ser
0b6b687d70 msgstore_memory: add comment about Append dropping messages 2021-11-03 18:25:39 +01:00
Simon Ser
193c0afd69 msgstore_fs: abort on timeout 2021-11-03 18:21:12 +01:00
Simon Ser
ce69f00e3f msgstore: add context to messageStore methods
This allows setting a hard timeout.
2021-11-03 18:21:05 +01:00
Simon Ser
2b4f0a870f msgstore: take Network as arg instead of network
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.
2021-11-03 16:37:01 +01:00
delthas
03f8972305 Add support for draft/event-playback 2021-11-03 15:17:16 +01:00
Simon Ser
a6aa7f0008 Make Network.Nick optional
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
2021-11-02 23:33:17 +01:00
Simon Ser
ce3d6df6b8 db_sqlite: use TEXT instead of VARCHAR
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.
2021-11-02 22:58:50 +01:00
Simon Ser
07c962018d Add title config option
Closes: https://todo.sr.ht/~emersion/soju/146
2021-11-02 22:38:07 +01:00
Simon Ser
832d8b89a2 Mark bouncer users and BouncerServ as authenticated in WHOX/WHOIS 2021-11-02 18:32:39 +01:00
Simon Ser
241e27b00e 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
2021-11-02 18:25:43 +01:00
Simon Ser
8c7c907d6f Fix operator flag in RPL_WHOREPLY
@ and + indicate channel privileges. * indicates that the user is
a server operator.
2021-11-01 18:36:21 +01:00
Simon Ser
62d92c660f Mark admins as server operators in self WHO/WHOIS replies 2021-11-01 18:32:01 +01:00
Simon Ser
3ab8ef17df 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.
2021-11-01 18:28:19 +01:00
Simon Ser
4e35b4812f Fix missing imports in server.go
Oops.
2021-10-29 16:18:34 +02:00
Simon Ser
aa407a46e6 Get rid of io.EOF errors in logs
Closes: https://todo.sr.ht/~emersion/soju/150
2021-10-29 16:03:04 +02:00
Simon Ser
0cd18a78db Unify BOUNCER ADDNETWORK and CHANGENETWORK 2021-10-29 15:51:13 +02:00
Simon Ser
de38d93085 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.
2021-10-28 11:29:34 +02:00
Simon Ser
9ec1f1a5b0 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.
2021-10-18 19:15:15 +02:00
Simon Ser
4be6c4b19c Remove unnecessary downstream cap checks
downstreamConn.SendMessage already performs this cap checking.
2021-10-18 09:20:11 +02:00
Simon Ser
1507e88b36 Remove incorrect AWAY TODO in downstreamConn.SendMessage
PRIVMSG/NOTICE get RPL_AWAY, not AWAY.
2021-10-18 09:08:52 +02:00
Simon Ser
324d0fb0ac Unify away-notify and account-notify handling 2021-10-17 21:54:18 +02:00
Simon Ser
455fef2421 Add support for account-notify 2021-10-17 21:54:18 +02:00
Simon Ser
2f495e9768 Remove unused REGISTRATION_IS_COMPLETED in handleMessageUnregistered
downstreamConn.handleMessageUnregistered is only called when the
user isn't registered.
2021-10-16 11:42:32 +02:00
Simon Ser
ade59beb8c Send BOUNCER REGISTRATION_IS_COMPLETED error 2021-10-16 11:41:37 +02:00
Hubert Hirtz
350057e60b Set hard timeouts on DB transactions 2021-10-15 22:39:14 +02:00
Simon Ser
2ce97bcc12 msgstore_fs: rename log dir when network is renamed 2021-10-15 18:11:04 +02:00
Simon Ser
b1d89163f8 ci: switch to alpine/latest
We don't need the bleeding edge.
2021-10-15 09:59:53 +02:00
Simon Ser
04d671121c msgstore_fs: add reference to ZNC 2021-10-14 20:51:03 +02:00
Alexey Yerin
3109340651 downstream: handle name=... in BOUNCER 2021-10-14 16:03:14 +02:00
Simon Ser
28e1ca51e7 db_postgres: remove unnecessary DEFAULT NULL in schema 2021-10-14 10:09:01 +02:00
Simon Ser
d334bb18a2 db_postgres: use tx for all queries in StoreClientDeliveryReceipts 2021-10-13 19:15:50 +02:00
Simon Ser
79dbb20f98 db_postgres: quote table name in StoreClientDeliveryReceipts 2021-10-13 17:38:20 +02:00
Simon Ser
2ed4491c17 Don't strip spaces at start of MOTD
This breaks ASCII art. Instead, just drop the final newline if any.
2021-10-13 12:53:43 +02:00
Simon Ser
a9a066faac Add bouncer MOTD
Closes: https://todo.sr.ht/~emersion/soju/137
2021-10-13 10:58:34 +02:00
Simon Ser
ca9fa9198c db_postgres: fix constraints errors
Stop using ON CONFLICT DO UPDATE.

Closes: https://todo.sr.ht/~emersion/soju/138
2021-10-13 10:12:14 +02:00
Hubert Hirtz
eb41ed4171 db_postgres: handle both constraints on network updates
Closes: https://todo.sr.ht/~emersion/soju/138
2021-10-13 08:53:49 +02:00
Simon Ser
d646ffc9d6 contrib/clients: update IRCv3 caps for Weechat 3.3 2021-10-12 21:49:06 +02:00
Simon Ser
c8aba6286f doc.soju.1: fix typo and improve formatting for "certfp generate" 2021-10-12 21:34:25 +02:00