READ lets downstream clients share information between each other about
what messages have been read by other downstreams.
Each target/entity has an optional corresponding read receipt, which is
stored as a timestamp.
- When a downstream sends:
READ #chan timestamp=2020-01-01T01:23:45.000Z
the read receipt for that target is set to that date
- soju sends READ to downstreams:
- on JOIN, if the client uses the soju.im/read capability
- when the read receipt timestamp is set by any downstream
The read receipt date is clamped by the previous receipt date and the
current time.
git-svn-id: file:///srv/svn/repo/suika/trunk@781 f0ae65fe-ee39-954e-97ec-027ff2717ef4
A previous fix (d4b7bb02da1c) only fixed sending echo-message for
TAGMSG to self. We also need to send echo-message for TAGMSG to
other targets.
Closes: https://todo.sr.ht/~emersion/soju/111
git-svn-id: file:///srv/svn/repo/suika/trunk@780 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This param doesn't contain modes, it contains user flags (such as
H/G for away status).
git-svn-id: file:///srv/svn/repo/suika/trunk@779 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Isolate the field letter -> value logic into a separate function.
git-svn-id: file:///srv/svn/repo/suika/trunk@778 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Instead of always requiring users to explicitly specify the network
name, guess it from the downstream connection.
Network commands are left as-is because it's not yet clear how to
handle them.
git-svn-id: file:///srv/svn/repo/suika/trunk@771 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Right now there is no consistent ordering in the network list:
no ORDER BY in the DB, and network updates move entries to the end.
Let's always sort by network ID so that users don't see the entries
move around.
I've contemplated sorting by Network.GetName() instead, but:
- Clients have now way to figure out dynamic order changes, e.g.
when renaming a network.
- Some clients might use ISUPPORT NETWORK when a user hasn't
explicitly named a network, but soju won't use that for ordering,
leading to non-alphabetic ordering in the client.
Let's leave it to clients to sort the networks by display name if
they want to.
git-svn-id: file:///srv/svn/repo/suika/trunk@769 f0ae65fe-ee39-954e-97ec-027ff2717ef4
The various server goroutines would always capture the last listen
addr in the loop.
git-svn-id: file:///srv/svn/repo/suika/trunk@767 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Instead of stopping to listen, retry on temporary failure. This
can happen when running out of FDs.
Closes: https://todo.sr.ht/~emersion/soju/183
git-svn-id: file:///srv/svn/repo/suika/trunk@766 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This avoids blocking on upstream message rate limiting for too
long.
git-svn-id: file:///srv/svn/repo/suika/trunk@757 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If a user goroutine panics, this correctly removes it from the
global map instead of leaving a dangling entry behind.
git-svn-id: file:///srv/svn/repo/suika/trunk@756 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Sometimes this command times out. Display the number of skipped
users.
git-svn-id: file:///srv/svn/repo/suika/trunk@755 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Makes it clearer what these fields are used for. The default value
for dc.nick is "*".
git-svn-id: file:///srv/svn/repo/suika/trunk@754 f0ae65fe-ee39-954e-97ec-027ff2717ef4
Makes it easy to print debugging messages which aren't targeted at
the user. See [1] for motivation.
[1]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging
git-svn-id: file:///srv/svn/repo/suika/trunk@747 f0ae65fe-ee39-954e-97ec-027ff2717ef4
It's extra code for something clients should ignore because it's
unreliable and useless.
git-svn-id: file:///srv/svn/repo/suika/trunk@745 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If the nickname we want is taken, fallback to another one by
appending underscores. Use MONITOR to figure out when we can request
our desired nick again.
Closes: https://todo.sr.ht/~emersion/soju/35
git-svn-id: file:///srv/svn/repo/suika/trunk@743 f0ae65fe-ee39-954e-97ec-027ff2717ef4
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
Instead of hand-rolling our own rate-limiter based on goroutines,
use golang.org/x/time/rate.
git-svn-id: file:///srv/svn/repo/suika/trunk@741 f0ae65fe-ee39-954e-97ec-027ff2717ef4
If a client queues a high number of commands and then disconnects,
remove all of the pending commands. This avoids unnecessarily
sending commands whose results won't be used.
git-svn-id: file:///srv/svn/repo/suika/trunk@738 f0ae65fe-ee39-954e-97ec-027ff2717ef4
The first reconnection attempt waits for 1min, the second the 2min,
and so on up to 10min. There's a 1min jitter so that multiple failed
connections don't try to reconnect at the exact same time.
Closes: https://todo.sr.ht/~emersion/soju/161
git-svn-id: file:///srv/svn/repo/suika/trunk@735 f0ae65fe-ee39-954e-97ec-027ff2717ef4