Neale Pickett
·
2015-02-09
PROTOCOL.md
1wirc protocol
2===========
3
4This document attempts to describe the wirc protocol.
5The source code will always be authoritative,
6but this protocol has been around for a while now so should be changed often, if ever.
7
8
9Out Queue
10---------
11
12
13Any files that appear in the directory outq/ are written verbatim to the IRC server.
14
15You may put multiple lines in a single file.
16
17Filenames beginning with "." are ignored.
18
19You are advised to create files beginning with ".",
20then rename them on completion of the write,
21to avoid race conditions.
22
23
24Log
25---
26
27### Log Filenames
28
29TBD
30
31
32### Log Messages
33
34IRC messages are written to the log, one message per line.
35Messages are translated to an easier-to-parse format:
36
37 timestamp fullname command sender forum [args...] :text
38
39Where:
40
41* `timestamp` is in Unix epoch time.
42* `fullname` is the full name of the message origin (typically `nick!user@host.name`)
43* `command` is the IRC command
44* `sender` is the IRC name of the entity that sent the message
45* `forum` is the IRC name of the audience of the message
46* `args` are any additional arguments not otherwise covered
47* `text` is the text of the message
48
49`sender` and `forum` are provided in every message, for the convenience of the client.
50A PRIVMSG to `sender` will make it back to whomever sent the message,
51a PRIVMSG to `forum` will be seen by everyone in the audience.
52
53For example, a "private message" will have `sender` equal to `forum`.
54But a "channel message" will have `forum` set to the channel.
55
56See `wirc.go` for details of each message type.
57
58
59### Initial Messages
60
61Each log file will contain the following initial messages,
62to facilitate stateful clients:
63
64TBD