soju forked to be LESS SHIT
Go to file
delthas f7894e612b Add support for downstream CHATHISTORY
This adds support for the WIP (at the time of this commit)
draft/chathistory extension, based on the draft at [1] and the
additional comments at [2].

This gets the history by parsing the chat logs, and is therefore only
enabled when the logs are enabled and the log path is configured.

Getting the history only from the logs adds some restrictions:
- we cannot get history by msgid (those are not logged)
- we cannot get the users masks (maybe they could be inferred from the
  JOIN etc, but it is not worth the effort and would not work every
  time)

The regular soju network history is not sent to clients that support
draft/chathistory, so that they can fetch what they need by manually
calling CHATHISTORY.

The only supported command is BEFORE for now, because that is the only
required command for an app that offers an "infinite history scrollback"
feature.

Regarding implementation, rather than reading the file from the end in
reverse, we simply start from the beginning of each log file, store each
PRIVMSG into a ring, then add the last lines of that ring into the
history we'll return later. The message parsing implementation must be
kept somewhat fast because an app could potentially request thousands of
messages in several files. Here we are using simple sscanf and indexOf
rather than regexps.

In case some log files do not contain any message (for example because
the user had not joined a channel at that time), we try up to a 100 days
of empty log files before giving up.

[1]: https://github.com/prawnsalad/ircv3-specifications/pull/3/files
[2]: https://github.com/ircv3/ircv3-specifications/pull/393/files#r350210018
2020-06-05 23:50:31 +02:00
cmd Allow multiple listeners, default to ircs 2020-06-04 20:16:23 +02:00
config Allow multiple listeners, default to ircs 2020-06-04 20:16:23 +02:00
doc Allow multiple listeners, default to ircs 2020-06-04 20:16:23 +02:00
.build.yml ci: add builds.sr.ht manifest 2020-03-18 10:28:58 +01:00
.gitignore doc: document "network delete" 2020-04-01 17:38:09 +02:00
bridge.go Add support for multiple user channel memberships 2020-05-11 12:25:49 +02:00
conn.go Introduce ircConn 2020-06-04 17:27:57 +02:00
db.go Implement upstream SASL EXTERNAL support 2020-06-02 11:24:22 +02:00
downstream.go Add support for downstream CHATHISTORY 2020-06-05 23:50:31 +02:00
go.mod Remove some IRCv3 constants 2020-03-19 14:51:45 +01:00
go.sum Remove some IRCv3 constants 2020-03-19 14:51:45 +01:00
irc.go Add support for TAGMSG and client message tags 2020-05-27 23:48:08 +02:00
LICENSE Switch license to AGPLv3 2020-02-07 17:41:51 +01:00
logger.go Add support for downstream CHATHISTORY 2020-06-05 23:50:31 +02:00
Makefile Move man page to doc/ 2020-03-27 19:23:41 +01:00
README.md Allow multiple listeners, default to ircs 2020-06-04 20:16:23 +02:00
ring.go Remove Ring.consumers 2020-04-07 14:46:31 +02:00
server.go Add support for downstream CHATHISTORY 2020-06-05 23:50:31 +02:00
service.go Introduce ircConn 2020-06-04 17:27:57 +02:00
upstream.go Fix handling of empty response to SASL challenge 2020-06-05 11:35:43 +02:00
user.go Add network update command 2020-06-04 13:04:39 +02:00

soju

builds.sr.ht status

A user-friendly IRC bouncer.

  • Multi-user
  • Support multiple clients for a single user, with proper backlog synchronization
  • Support connecting to multiple upstream servers via a single IRC connection to the bouncer

Usage

go run ./cmd/sojuctl create-user <username>
go run ./cmd/soju -listen irc+insecure://127.0.0.1:6667

Then connect with username <username>/chat.freenode.net and join #soju.

See the man page at doc/soju.1.scd for more information.

Contributing

Send patches on the mailing list or on GitHub, report bugs on the issue tracker. Discuss in #soju on Freenode.

License

AGPLv3, see LICENSE.

Copyright (C) 2020 Simon Ser