Skip to content
Aravind edited this page Jun 10, 2013 · 4 revisions

Message objects have properties id, type, from, to, text, ref, time, votes, head and [[labels]].

id

A unique numeric message ID.

type

Gateways carry out write actions primarily by sending messages of special types. Message types include:

  • text: A normal message from a user.
  • join: The from room wishes to follow the to room.
  • part: Stops following.
  • back: Sent from a room to rooms it is following, indicating that it has come online.
  • away: Gone offline
  • nick: A user changes his/her nickname, e.g. by signing in. Sign in works through nick messages.

To be implemented later:

  • call: Instructs the room to invite someone. The full semantics need to be worked out.
  • vote: Up-votes a previous message (indicated by its ID in ref)
  • desc: Sets a description for a label (indicated by its ID in ref)
  • edit: An edit to a previous message (indicated by its ID in ref). Edits are stored separately from the original message but will be returned by core.read in its place.

from, to

These are room IDs.

text

Freeform text typed by a human.

ref

Depends on the message type. Currently unused.

time

Unix time, with milliseconds, when the message was received by the server.

votes

The number of votes received by the message. This field is updated after the message has been added (as votes are received).

head

The ID of the latest revision (edit) of this message. This is udpated after the message has been added.

labels

Array of labels applied to this message.

Clone this wiki locally