irc.connect:
{
id: <id>, // a unique identifier for this connection
server: <host>,
port: <port>,
nick: <nick>,
channels: [<channel>, ...] | []
}
irc.join:
{
id: <id>,
channel: <channel>
}
irc.message:
{
id: <id>,
type: "say" | "ctcp" | "action" | "notice"
target: <target>,
message: <message>
}
irc.whois:
{
id: <id>,
nick: <nick>
}
irc.list: // lists rooms
{
id: <id>,
args: [<arg>, ...] | []
}
TODO: how do we handle unknown commands?? (e.g., /blah)
irc.message:
{
id: <id>, // connnection
type: "message" | "notice" | "privmsg"
from: <from>,
to: ...,
message: ...
}
irc.event:
{
id: <id>,
type: "join" | "part"
channel: ...,
nick: ...
}
irc.whois:
{
id: <id>,
nick: ...,
info: // http://node-irc.readthedocs.org/en/latest/API.html#%27whois%27
}
irc.list:
{
id: <id>,
list: [...]
}
irc.error:
{
id: <id>,
message: <message>
}
- communicates with the server (using API defined above)
- calls UI function
listen
with callback that will be invoked on user inputcallback(message, currentContext)
- calls
Context.send
withmessage
when it wants something displayedsend({ type: "message" | "action" | "whois" | "names" | ..., content: String | Array | Object })
- creates
new Context
and callsaddTab
with it when necessary
(e.g., when joining new channels)