ec2c0685dd
This adds a new field to upstreams, members, which is a casemapped map of upstream users known to the soju. The upstream users known to soju are: self, any monitored user, and any user with whom we share a channel. The information stored for each upstream user corresponds to the info that can be returned by a WHO/WHOX command. We build the upstream user information both incrementally, capturing information contained in JOIN and AWAY messages; and with the bulk user information contained in WHO replies we receive. This lets us build a user cache that can then be used to return synthetic WHO responses to later WHO requests by downstreams. This is useful because some networks (eg Libera) heavily throttle WHO commands, and without this cache, any downstream connecting would send 1 WHO command per channel, so possibly more than a dozen WHO commands, which soju then forwarded to the upstream as WHO commands. With this cache most WHO commands can be cached and avoid sending WHO commands to the upstream. In order to cache the "flags" field, we synthetize the field from user info we get from incremental messages: away status (H/G) and bot status (B). This could result in incorrect values for proprietary user fields. Support for the server-operator status (*) is also not supported. Of note is that it is difficult to obtain a user "connected server" field incrementally, so clients that want to maximize their WHO cache hit ratio can use WHOX to only request fields they need, and in particular not include the server field flag. Co-authored-by: delthas <delthas@dille.cc> |
||
---|---|---|
cmd | ||
config | ||
contrib | ||
database | ||
doc | ||
identd | ||
msgstore | ||
xirc | ||
.build.yml | ||
.editorconfig | ||
.gitignore | ||
certfp.go | ||
config.in | ||
conn.go | ||
downstream.go | ||
go.mod | ||
go.sum | ||
irc_test.go | ||
irc.go | ||
LICENSE | ||
Makefile | ||
net_go113.go | ||
net_go116.go | ||
rate.go | ||
README.md | ||
server_test.go | ||
server.go | ||
service_test.go | ||
service.go | ||
upstream.go | ||
user.go |
soju
soju is a user-friendly IRC bouncer. soju connects to upstream IRC servers on behalf of the user to provide extra functionality. soju supports many features such as multiple users, numerous IRCv3 extensions, chat history playback and detached channels. It is well-suited for both small and large deployments.
Usage
Building and installing
Dependencies:
- Go
- BSD or GNU make
- a C89 compiler (optional, for SQLite)
- scdoc (optional, for man pages)
For end users, a Makefile
is provided:
make
sudo make install
For development, you can use go run ./cmd/soju
as usual.
To link with the system libsqlite3, set GOFLAGS="-tags=libsqlite3"
. To disable
SQLite support, set GOFLAGS="-tags=nosqlite"
.
To use an alternative SQLite library that does not require CGO, set GOFLAGS="-tags=moderncsqlite"
.
Contributing
Send patches on the mailing list or on GitHub, report bugs on the issue tracker. Discuss in #soju on Libera Chat.
License
AGPLv3, see LICENSE.
Copyright (C) 2020 The soju Contributors