Update clog.md
This commit is contained in:
parent
7c9df6ff95
commit
8ea54dd6f8
18
clog.md
18
clog.md
|
@ -1,4 +1,4 @@
|
||||||
CAP prefix/clog
|
CAP soniex2.github.io/clog
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Copyright (c) 2018 Soni L. \<fakedme plus irkv3 at gmail dot com>
|
Copyright (c) 2018 Soni L. \<fakedme plus irkv3 at gmail dot com>
|
||||||
|
@ -12,13 +12,13 @@ Cap syntax
|
||||||
|
|
||||||
The capability shall be specified as
|
The capability shall be specified as
|
||||||
|
|
||||||
prefix/clog=hash_type,hash_type/tag,tag,tag
|
soniex2.github.io/clog=hash_type,hash_type/tag,tag,tag
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
prefix/clog=sha1,sha256/server-time,prefix/hash
|
soniex2.github.io/clog=sha1,sha256/time,soniex2.github.io/clog
|
||||||
|
|
||||||
`server-time` and `prefix/hash` are always implicitly specified, and should be omitted.
|
`time` and `soniex2.github.io/clog` are always implicitly specified, and should be omitted.
|
||||||
|
|
||||||
The `HASH` S2C command
|
The `HASH` S2C command
|
||||||
----------------------
|
----------------------
|
||||||
|
@ -48,22 +48,22 @@ Optionally, the server may include a server name with the HASH command:
|
||||||
<<< :server1.example.com HASH #channel :etc
|
<<< :server1.example.com HASH #channel :etc
|
||||||
<<< :server2.example.com HASH #channel :other
|
<<< :server2.example.com HASH #channel :other
|
||||||
|
|
||||||
The `hash` message tag
|
The `clog` message tag
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
The `hash` mesaage tag shall be sent with every `PRIVMSG`, `TOPIC` and `NOTICE`.
|
The `clog` message tag shall be sent with every `PRIVMSG`, `TOPIC` and `NOTICE`.
|
||||||
|
|
||||||
Syntax:
|
Syntax:
|
||||||
|
|
||||||
prefix/hash=type=counter/short_hash,type=counter/short_hash,...
|
soniex2.github.io/clog=type=counter/short_hash,type=counter/short_hash,...
|
||||||
|
|
||||||
The use of `short_hash` lowers bandwidth requirements. Consult your cryptography expert for best practices on using cryptography.
|
The use of `short_hash` lowers bandwidth requirements. Consult your cryptography expert for best practices on using cryptography.
|
||||||
|
|
||||||
These hashes specify the previous "head(s)" of the clog. "Merges" are just messages with hashes from different sources.
|
These hashes specify the previous "head(s)" of the clog. "Merges" are just messages with hashes from different sources.
|
||||||
|
|
||||||
The hash encompasses the message tags specified by the capability (e.g. `server-time` and `hash`), sorted according to UTF-8 byte order, and the contents of the IRC message, as seen in the following format:
|
The hash encompasses the message tags specified by the capability (e.g. `time` and `clog`), sorted according to UTF-8 byte order, and the contents of the IRC message, as seen in the following format:
|
||||||
|
|
||||||
@prefix/hash=...;server-time=... :nick!user@host PRIVMSG #channel :message
|
@soniex2.github.io/clog=...;time=... :nick!user@host PRIVMSG #channel :message
|
||||||
|
|
||||||
(This line is what gets hashed)
|
(This line is what gets hashed)
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ impl fmt::Display for Hash {
|
||||||
struct ServerData {
|
struct ServerData {
|
||||||
hashes: BTreeSet<Hash>,
|
hashes: BTreeSet<Hash>,
|
||||||
message_queue: HashMap<String, VecDeque<(BTreeSet<Hash>, String)>>, // (source) server name -> messages
|
message_queue: HashMap<String, VecDeque<(BTreeSet<Hash>, String)>>, // (source) server name -> messages
|
||||||
|
users: BTreeSet<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ServerData {
|
impl ServerData {
|
||||||
|
@ -74,6 +75,7 @@ impl ServerData {
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct Game {
|
struct Game {
|
||||||
servers: BTreeMap<String, ServerData>,
|
servers: BTreeMap<String, ServerData>,
|
||||||
|
users: BTreeSet<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Game {
|
impl Game {
|
||||||
|
|
Loading…
Reference in New Issue