From 8d165d1a07ea00a9a1a64dcd50f5a4105a220b80 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 12 Aug 2014 23:32:59 +0000 Subject: [PATCH] Rename things, document protocol --- PROTOCOL | 64 +++++++++++++++++++++++++++++++++++++++ irc.cgi.go => wirc.cgi.go | 0 irc.css => wirc.css | 0 irc.go => wirc.go | 0 irc.js => wirc.js | 0 5 files changed, 64 insertions(+) create mode 100644 PROTOCOL rename irc.cgi.go => wirc.cgi.go (100%) rename irc.css => wirc.css (100%) rename irc.go => wirc.go (100%) rename irc.js => wirc.js (100%) diff --git a/PROTOCOL b/PROTOCOL new file mode 100644 index 0000000..5710812 --- /dev/null +++ b/PROTOCOL @@ -0,0 +1,64 @@ +wirc protocol +=========== + +This document attempts to describe the wirc protocol. +The source code will always be authoritative, +but this protocol has been around for a while now so should be changed often, if ever. + + +Out Queue +--------- + + +Any files that appear in the directory outq/ are written verbatim to the IRC server. + +You may put multiple lines in a single file. + +Filenames beginning with "." are ignored. + +You are advised to create files beginning with ".", +then rename them on completion of the write, +to avoid race conditions. + + +Log +--- + +### Log Filenames + +TBD + + +### Log Messages + +IRC messages are written to the log, one message per line. +Messages are translated to an easier-to-parse format: + + timestamp fullname command sender forum [args...] :text + +Where: + +* `timestamp` is in Unix epoch time. +* `fullname` is the full name of the message origin (typically `nick!user@host.name`) +* `command` is the IRC command +* `sender` is the IRC name of the entity that sent the message +* `forum` is the IRC name of the audience of the message +* `args` are any additional arguments not otherwise covered +* `text` is the text of the message + +`sender` and `forum` are provided in every message, for the convenience of the client. +A PRIVMSG to `sender` will make it back to whomever sent the message, +a PRIVMSG to `forum` will be seen by everyone in the audience. + +For example, a "private message" will have `sender` equal to `forum`. +But a "channel message" will have `forum` set to the channel. + +See `wirc.go` for details of each message type. + + +### Initial Messages + +Each log file will contain the following initial messages, +to facilitate stateful clients: + +TBD diff --git a/irc.cgi.go b/wirc.cgi.go similarity index 100% rename from irc.cgi.go rename to wirc.cgi.go diff --git a/irc.css b/wirc.css similarity index 100% rename from irc.css rename to wirc.css diff --git a/irc.go b/wirc.go similarity index 100% rename from irc.go rename to wirc.go diff --git a/irc.js b/wirc.js similarity index 100% rename from irc.js rename to wirc.js