Simon Ser
d5dd194b01
downstream: fix WHO membership prefix order without server-specific flags
...
Gregory noticed that my last-minute edit was wrong [1]. Indeed,
when i == -1, that means that Flags only contains 'H'/'G'/'*' and
nothing else. We need to append the membership prefix in that case.
[1]: https://lists.sr.ht/~emersion/soju-dev/%3C20240630213249.13061-2-greg@gpanders.com%3E#%3CD2DP18U4PP40.DBYWGA8WM2KN@gpanders.com%3E
Fixes: ae203388e1
("Fix channel membership prefixes in cached WHO replies")
Reported-by: Gregory Anders <greg@gpanders.com>
2024-07-01 00:14:06 +02:00
Gregory Anders
ae203388e1
Fix channel membership prefixes in cached WHO replies
...
Channel membership prefixes in WHO replies (RPL_WHOREPLY and
RPL_WHOSPCRPL) were cached in the user's flags, which meant those same
prefixes were returned on future cache hits, even though the flags are
channel specific.
Strip the channel membership prefixes from the user's flags before
adding a user to the cache and add the prefixes back when reading from
the cache (using the membership info from the NAMES reply).
2024-06-30 23:50:50 +02:00
jacob1
0ecc9cd042
Include prefix in CAP messages again
...
Buggy clients like hexchat can't parse CAP otherwise, making it unable to connect at all. Prefix on CAP commands must be pretty ubiquitous if a major issue like that was never caught
2024-05-07 16:15:54 +02:00
Simon Ser
c36140fb2a
Drop source prefix from most non-numeric server messages
...
Clients are supposed to handle these just fine without a source
prefix.
2024-04-30 14:39:19 +02:00
Simon Ser
6b13ca5f34
Drop unnecessary prefixes for numerics
...
Previous commit populates the source prefix automatically for all
numerics. Drop the now-unnecessary explicit source prefix.
2024-04-30 14:38:20 +02:00
Simon Ser
51a12983d8
downstream: ensure numerics always carry a source prefix
...
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
2024-04-30 14:23:49 +02:00
Simon Ser
d5108f3994
downstream: shallow copy message in SendMessage instead of deep copy
2024-04-30 14:22:15 +02:00
jacob1
fbcda7b963
Fix missing prefix on away numerics
...
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
2024-04-30 14:19:15 +02:00
Simon Ser
741fd040bb
downstream: fix FILEHOST endpoint
2024-01-25 13:09:49 +01:00
Simon Ser
fd4aa892b2
Add http-ingress config directive
...
Co-authored-by: delthas <delthas@dille.cc>
2024-01-24 23:32:24 +01:00
Simon Ser
b76cb6d5e6
Add support for file uploads
...
Co-authored-by: delthas <delthas@dille.cc>
2024-01-24 23:32:07 +01:00
Simon Ser
d423a1ca24
Add conn.Shutdown
...
References: https://todo.sr.ht/~emersion/soju/156
2023-12-11 11:50:16 +01:00
Simon Ser
e9678cee2f
downstream: use fresh context to send timeout errors
...
Using an expired context will never actually send the error message
here.
2023-12-11 11:39:57 +01:00
Simon Ser
67f7d9aa3f
Add support for draft/no-implicit-names
...
Same as the soju extension.
2023-11-27 13:49:40 +01:00
Simon Ser
e19dd8f0da
database: add NewNetwork
2023-10-31 23:51:04 +01:00
Simon Ser
73e594d59d
Remove remnant comments about multi-upstream mode
2023-10-03 10:14:55 +02:00
Eric Mertens
60b041419a
Only log unhandled messages in debug mode
2023-09-22 23:31:02 +09:00
Simon Ser
fe64c795cd
Use downstreamConn.upstreamForCommand when handling user MODE
...
Provides uniform error messages.
2023-08-31 00:09:57 +09:00
Eric Mertens
d6fc01e44a
Forward complete MODE message to upstream when changing modes
2023-08-31 00:06:35 +09:00
Eric Mertens
be3c6d72c1
Add support for STATUSMSG
...
This passes the STATUSMSG isupport through, and it ignores statusmsg prefix when routing messages through the PRIVMSG, NOTICE, and TAGMSG handler so they will show up in the correct history. Because it doesn't modify the message the statusmsg sigils show up correctly for the user on receipt.
Without this PR the statusmsg messages still come through to the client, but they get misrouted by clients expecting STATUSMSG to be specified in 005 and they don't go into the right channel history.
Closes: https://todo.sr.ht/~emersion/soju/124
2023-08-26 12:37:20 +02:00
Simon Ser
01b28fa85d
Use * instead of nick in some numeric replies
...
This argument is supposed to be the destination client, but is
useless. Simplify our functions by sending * instead.
2023-08-23 19:50:37 +02:00
Eric Mertens
3650446156
Pass MODE and TOPIC through for unjoined channels
2023-08-23 19:44:55 +02:00
Eric Mertens
e43e472c53
Fix capability associated with account message-tag
2023-08-13 09:38:01 +02:00
Simon Ser
97cfb366b0
Replace soju.im/pre-away with draft/pre-away
...
The IRCv3 draft spec ended up being merged!
2023-08-03 20:14:46 +02:00
Simon Ser
c36bb342fb
Introduce soju.im/pre-away
...
The IRCv3 spec is stalled, so let's just ship a vendored extension
for now.
References: https://github.com/ircv3/ircv3-specifications/pull/514
2023-08-03 19:38:31 +02:00
Simon Ser
c8d5c90d9d
downstream: improve SASL error logging
2023-06-01 11:37:03 +02:00
Simon Ser
fa33ce986c
downstream: fix nick in auth error message
...
We were always printing "*" here.
2023-05-23 18:28:50 +02:00
Simon Ser
9b9fc60f62
Rename Config.Log{Driver,Path} to MsgStore
2023-05-23 11:23:38 +02:00
Simon Ser
6f01bd86c3
downstream: pass context to SendMessage
...
Just like upstream does.
2023-04-06 13:23:20 +02:00
Simon Ser
43e6febc15
downstream: error out if SASL PLAIN identity is specified
2023-04-05 21:18:57 +02:00
Simon Ser
b3be05559b
downstream: add support for ANONYMOUS SASL auth
...
This clears any saved SASL credentials.
Closes: https://todo.sr.ht/~emersion/soju/198
2023-04-05 21:15:18 +02:00
Simon Ser
92796248d2
downstream: rename downstreamRegistration.password to pass
...
This is more descriptive.
2023-04-05 20:30:34 +02:00
Simon Ser
f6043e5b98
Stop setting *user in downstreamConn.register
...
Set it in downstreamConn.welcome instead. Makes it clearer that it
must not be accessed before welcome is called (because it can only
be accessed from the user goroutine).
2023-04-05 16:54:55 +02:00
Simon Ser
c5079f7ac3
downstream: fix connection registration
...
Fixes: 1df1ccf91e
("downstream: take irc.Message in handleCap")
2023-04-05 16:53:18 +02:00
Simon Ser
8637550e68
downstream: inline authenticate function
2023-04-05 15:43:51 +02:00
Simon Ser
1df1ccf91e
downstream: take irc.Message in handleCap
2023-04-05 14:35:51 +02:00
Simon Ser
de02cb98fe
downstream: return FAIL on unknown BOUNCER command before registration
2023-04-05 13:36:36 +02:00
Simon Ser
f12f10a7bb
downstream: return channel in cached WHO reply
...
References: https://github.com/ircdocs/modern-irc/pull/211
2023-04-05 10:54:43 +02:00
Simon Ser
be6cc27981
downstream: set CLIENTTAGDENY=* when upstream is missing message-tags
2023-03-28 18:48:47 +02:00
Simon Ser
9579998e63
downstream: fix panic due to nil user in setUser
...
Fixes: 4ca8dfa37d
("downstream: fix nil pointer deref in downstreamConn.setUser")
2023-03-21 18:02:59 +01:00
Simon Ser
93af53c91d
Prune old Web Push subscriptions
2023-03-17 00:00:50 +01:00
Simon Ser
4ca8dfa37d
downstream: fix nil pointer deref in downstreamConn.setUser
...
References: https://lists.sr.ht/~emersion/soju-dev/%3CCR6PX9SU5FSO.3UR92LHKXOXML%40hades.moritz.sh%3E
2023-03-15 17:34:18 +01:00
Simon Ser
6b82ed990c
downstream: fix nickCM out-of-sync with effective case-mapping
...
We were unconditionally using the ASCII case-mapping in updateNick(),
for instance.
Introduce downstreamConn.casemap to fix this, and use it everywhere.
2023-03-01 14:59:08 +01:00
Simon Ser
aecff32103
Introduce UserUpdateFunc
...
References: https://todo.sr.ht/~emersion/soju/206
2023-03-01 14:16:33 +01:00
Simon Ser
ebd101820b
Migrate casemapMap to xirc
2023-03-01 13:52:33 +01:00
Simon Ser
2b7a83b676
Take case-mapping as param in newCasemapMap()
...
Avoids situations where we forget to initialize it.
2023-03-01 13:43:51 +01:00
Simon Ser
de90648eaa
Rename casemapMap.setCasemapping to setCaseMapping
2023-03-01 13:35:03 +01:00
Simon Ser
3eb2679612
Migrate case-mapping to xirc
2023-03-01 13:35:03 +01:00
Simon Ser
07cd1f2f5d
Use generics for casemapMap
2023-03-01 13:15:38 +01:00
Simon Ser
3da6c23ad4
Pass-through ISUPPORT CASEMAPPING
2023-03-01 12:55:49 +01:00