Messages

Maintainer:Nick Jennings ni.nosp@m.ck@silverbu.nosp@m.cket.net
Original author:Niklas E. Cathor nilc.nosp@m.lass@riseu.nosp@m.p.net
Version:0.1.0

This module stores messages and drafts, as well as credentials for all of the various messaging protocols.

Summary
Messages
Schemas
email.recipientRepresents a recipient of a message.
messages/draftRepresents a saved message that hasn’t been sent yet.
messages/messageRepresents a received or sent message.
messages/xmpp-credentialsCredentials for an XMPP connection.
Exports
messages
accountreturns a Messages object.
MessagesRepresents a grouping of messages.
Properties
nameName of the account the messages are attatched to
poolDirect access to the message pool (a <DateIndexedScope>)
Functions
storeTakes a <message> object and stores it.
Variables
message.drafts
Functions
getLatestGet latest draft.
saveLatestSave given draft as latest one.

Schemas

email.recipient

Represents a recipient of a message.

Properties

nameName of the recipient
addressRFC822 compliant address (i.e. an email address)

messages/draft

Represents a saved message that hasn’t been sent yet.

Properties

actorSender of the message.  Same properties as email.recipient.
targetArray of email.recipient objects (including cc and bcc).
object.subjectMessage subject (a String).
object.textMessage body (a String).
object.dateMessage date.  For a draft this is set to last time the draft was saved.

messages/message

Represents a received or sent message.

Inherits from <message.draft>.

Requires the following properties to be set

  • <message.draft.target>,
  • <message.draft.object.subject>,
  • <message.draft.object.text> and
  • <message.draft.object.date>

messages/xmpp-credentials

Credentials for an XMPP connection.

Properties

actorobject:
nameThe account owner’s name.  This name is used as the sender name for outgoing messages.
addressThe address associated with this account.  Will be used as the sender address for outgoing messages.
usernameUsername to authenticate against XMPP server.
passwordPassword to authenticate against XMPP server.
serverHostname of the XMPP server.
resourceXMPP resource string (ie.  Home)
portPort to connect to.

Exports

messages

account

returns a Messages object.

Messages

Represents a grouping of messages.

Summary
Properties
nameName of the account the messages are attatched to
poolDirect access to the message pool (a <DateIndexedScope>)
Functions
storeTakes a <message> object and stores it.
Variables
message.drafts
Functions
getLatestGet latest draft.
saveLatestSave given draft as latest one.

Properties

name

Name of the account the messages are attatched to

pool

Direct access to the message pool (a <DateIndexedScope>)

Functions

store

store: function (message)

Takes a <message> object and stores it.

Variables

message.drafts

Functions

getLatest

getLatest: function ()

Get latest draft.

saveLatest

saveLatest: function (draft)

Save given draft as latest one.

Parameters

draftA <message.draft> Object
store: function (message)
Takes a message object and stores it.
getLatest: function ()
Get latest draft.
saveLatest: function (draft)
Save given draft as latest one.
Represents a recipient of a message.
Close