GithubHelp home page GithubHelp logo

ircel's Introduction

ircel

Protocol

Client -> Server

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)

Server -> Client

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>
}

Client

Controller

  • communicates with the server (using API defined above)
  • calls UI function listen with callback that will be invoked on user input
    • callback(message, currentContext)
  • calls Context.send with message when it wants something displayed
    • send({ type: "message" | "action" | "whois" | "names" | ..., content: String | Array | Object })
  • creates new Context and calls addTab with it when necessary
    (e.g., when joining new channels)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.