event.js

CandyChats are not dead yet.

Authors

Copyright

© 2011 Amiado Group AG.  All rights reserved.

Summary
event.js
Candy.Core.EventChat Events
Enumerations
KEYSObserver keys
Candy.Core.Event.StropheStrophe-related events
Functions
ConnectActs on strophe status events and notifies view.
LoginNotify view that the login window should be displayed
Candy.Core.Event.JabberJabber related events
Functions
VersionResponds to a version request
PresenceActs on a presence event
BookmarksActs on a bookmarks event.
PrivacyListActs on a privacy list event and sets up the current privacy list of this user.
PrivacyListErrorActs when a privacy list error has been received.
MessageActs on room, admin and server messages and notifies the view if required.
Candy.Core.Event.Jabber.RoomRoom specific events
Functions
LeaveLeaves a room and cleans up related data and notifies view.
DiscoSets informations to rooms according to the disco info received.
PresenceActs on various presence messages (room leaving, room joining, error presence) and notifies view.
PresenceErrorActs when a presence of type error has been retrieved.
MessageActs on various message events (subject changed, private chat message, multi-user chat message) and notifies view.

Candy.Core.Event

Chat Events

Parameters

(Candy.Core.Event) selfitself
(Strophe) StropheStrophe
(jQuery) $jQuery
(Candy.Util.Observable) observableObservable to mixin
Summary
Enumerations
KEYSObserver keys

Enumerations

KEYS

Observer keys

CHATChat events
PRESENCEPresence events
MESSAGEMessage events
LOGINLogin event

Candy.Core.Event.Strophe

Strophe-related events

Summary
Functions
ConnectActs on strophe status events and notifies view.
LoginNotify view that the login window should be displayed

Functions

Connect

Connect: function(status)

Acts on strophe status events and notifies view.

Parameters

(Strophe.Status) statusStrophe statuses

Login

self.Login = function(presetJid)

Notify view that the login window should be displayed

Parameters

(String) presetJidPreset user JID

Candy.Core.Event.Jabber

Jabber related events

Summary
Functions
VersionResponds to a version request
PresenceActs on a presence event
BookmarksActs on a bookmarks event.
PrivacyListActs on a privacy list event and sets up the current privacy list of this user.
PrivacyListErrorActs when a privacy list error has been received.
MessageActs on room, admin and server messages and notifies the view if required.

Functions

Version

Version: function(msg)

Responds to a version request

Parameters

(String) msgRaw XML Message

Returns

(Boolean)true

Presence

Presence: function(msg)

Acts on a presence event

Parameters

(String) msgRaw XML Message

Returns

(Boolean)true

Bookmarks

Bookmarks: function(msg)

Acts on a bookmarks event.  When a bookmark has the attribute autojoin set, joins this room.

Parameters

(String) msgRaw XML Message

Returns

(Boolean)true

PrivacyList

PrivacyList: function(msg)

Acts on a privacy list event and sets up the current privacy list of this user.

If no privacy list has been added yet, create the privacy list and listen again to this event.

Parameters

(String) msgRaw XML Message

Returns

(Boolean)false to disable the handler after first call.

PrivacyListError

PrivacyListError: function(msg)

Acts when a privacy list error has been received.

Currently only handles the case, when a privacy list doesn’t exist yet and creates one.

Parameters

(String) msgRaw XML Message

Returns

(Boolean)false to disable the handler after first call.

Message

Message: function(msg)

Acts on room, admin and server messages and notifies the view if required.

Parameters

(String) msgRaw XML Message

Returns

(Boolean)true

Candy.Core.Event.Jabber.Room

Room specific events

Summary
Functions
LeaveLeaves a room and cleans up related data and notifies view.
DiscoSets informations to rooms according to the disco info received.
PresenceActs on various presence messages (room leaving, room joining, error presence) and notifies view.
PresenceErrorActs when a presence of type error has been retrieved.
MessageActs on various message events (subject changed, private chat message, multi-user chat message) and notifies view.

Functions

Leave

Leave: function(msg)

Leaves a room and cleans up related data and notifies view.

Parameters

(String) msgRaw XML Message

Returns

(Boolean)true

Disco

Disco: function(msg)

Sets informations to rooms according to the disco info received.

Parameters

(String) msgRaw XML Message

Returns

(Boolean)true

Presence

Presence: function(msg)

Acts on various presence messages (room leaving, room joining, error presence) and notifies view.

Parameters

(Object) msgjQuery object of XML message

Returns

(Boolean)true

PresenceError

PresenceError: function(msg)

Acts when a presence of type error has been retrieved.

Parameters

(Object) msgjQuery object of XML message

Returns

(Boolean)true

Message

Message: function(msg)

Acts on various message events (subject changed, private chat message, multi-user chat message) and notifies view.

Parameters

(String) msgjQuery object of XML message

Returns

(Boolean)true
Connect: function(status)
Acts on strophe status events and notifies view.
self.Login = function(presetJid)
Notify view that the login window should be displayed
Version: function(msg)
Responds to a version request
Presence: function(msg)
Acts on a presence event
Bookmarks: function(msg)
Acts on a bookmarks event.
PrivacyList: function(msg)
Acts on a privacy list event and sets up the current privacy list of this user.
PrivacyListError: function(msg)
Acts when a privacy list error has been received.
Message: function(msg)
Acts on room, admin and server messages and notifies the view if required.
Leave: function(msg)
Leaves a room and cleans up related data and notifies view.
Disco: function(msg)
Sets informations to rooms according to the disco info received.
Presence: function(msg)
Acts on various presence messages (room leaving, room joining, error presence) and notifies view.
PresenceError: function(msg)
Acts when a presence of type error has been retrieved.
Message: function(msg)
Acts on various message events (subject changed, private chat message, multi-user chat message) and notifies view.
Close