Candy | Chats are not dead yet. |
© 2011 Amiado Group AG. All rights reserved. © 2012-2014 Patrick Stadler & Michael Weibel. All rights reserved.
event.js | |
Candy. | Chat Events |
Functions | |
Login | Notify view that the login window should be displayed |
Events | |
candy: | Triggered when the login window should be displayed |
Candy. | Strophe-related events |
Functions | |
Connect | Acts on strophe status events and notifies view. |
Events | |
candy: | Connection status updates |
Candy. | Jabber related events |
Functions | |
Version | Responds to a version request |
Presence | Acts on a presence event |
Events | |
candy: | Presence updates. |
Functions | |
Bookmarks | Acts on a bookmarks event. |
PrivacyList | Acts on a privacy list event and sets up the current privacy list of this user. |
PrivacyListError | Acts when a privacy list error has been received. |
Message | Acts on room, admin and server messages and notifies the view if required. |
Events | |
candy: | Incoming chat invite for a MUC. |
candy: | Incoming chat invite for a MUC. |
candy: | Messages with the type attribute of normal or those that do not have the optional type attribute. |
candy: | Messages with a type other than the ones listed in RFC3921 section 2.1.1. |
candy: | Admin message |
candy: | Server message (e.g. |
Candy. | Room specific events |
Functions | |
Leave | Leaves a room and cleans up related data and notifies view. |
Events | |
candy: | When the local client leaves a room |
Functions | |
Disco | Sets informations to rooms according to the disco info received. |
Presence | Acts on various presence messages (room leaving, room joining, error presence) and notifies view. |
Events | |
candy: | Room presence updates |
Functions | |
PresenceError | Acts when a presence of type error has been retrieved. |
Events | |
candy: | Triggered when a presence error happened |
Functions | |
Message | Acts on various message events (subject changed, private chat message, multi-user chat message) and notifies view. |
Events | |
candy: | Triggers on any recieved chatstate notification. |
candy: | Triggers on various message events (subject changed, private chat message, multi-user chat message). |
Chat Events
(Candy.Core.Event) self | itself |
(Strophe) Strophe | Strophe |
(jQuery) $ | jQuery |
Functions | |
Login | Notify view that the login window should be displayed |
Events | |
candy: | Triggered when the login window should be displayed |
Strophe-related events
Functions | |
Connect | Acts on strophe status events and notifies view. |
Events | |
candy: | Connection status updates |
Jabber related events
Functions | |
Version | Responds to a version request |
Presence | Acts on a presence event |
Events | |
candy: | Presence updates. |
Functions | |
Bookmarks | Acts on a bookmarks event. |
PrivacyList | Acts on a privacy list event and sets up the current privacy list of this user. |
PrivacyListError | Acts when a privacy list error has been received. |
Message | Acts on room, admin and server messages and notifies the view if required. |
Events | |
candy: | Incoming chat invite for a MUC. |
candy: | Incoming chat invite for a MUC. |
candy: | Messages with the type attribute of normal or those that do not have the optional type attribute. |
candy: | Messages with a type other than the ones listed in RFC3921 section 2.1.1. |
candy: | Admin message |
candy: | Server message (e.g. |
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.
(String) msg | Raw XML Message |
(Boolean) | false to disable the handler after first call. |
Incoming chat invite for a MUC.
(String) roomJid | The room the invite is to |
(String) from | User JID that invite is from text |
(String) reason | Reason for invite [default: ‘’] |
(String) password | Password for the room [default: null] |
(String) continuedThread | The thread ID if this is a continuation of a 1-on-1 chat [default: null] |
Incoming chat invite for a MUC.
(String) roomJid | The room the invite is to |
(String) from | User JID that invite is from text |
(String) reason | Reason for invite [default: ‘’] |
(String) password | Password for the room [default: null] |
(String) continuedThread | The thread ID if this is a continuation of a 1-on-1 chat [default: null] |
Room specific events
Functions | |
Leave | Leaves a room and cleans up related data and notifies view. |
Events | |
candy: | When the local client leaves a room |
Functions | |
Disco | Sets informations to rooms according to the disco info received. |
Presence | Acts on various presence messages (room leaving, room joining, error presence) and notifies view. |
Events | |
candy: | Room presence updates |
Functions | |
PresenceError | Acts when a presence of type error has been retrieved. |
Events | |
candy: | Triggered when a presence error happened |
Functions | |
Message | Acts on various message events (subject changed, private chat message, multi-user chat message) and notifies view. |
Events | |
candy: | Triggers on any recieved chatstate notification. |
candy: | Triggers on various message events (subject changed, private chat message, multi-user chat message). |
When the local client leaves a room
Also triggered when the local client gets kicked or banned from a room.
(String) roomJid | Room |
(String) roomName | Name of room |
(String) type | Presence type [kick, ban, leave] |
(String) reason | When type equals kick|ban, this is the reason the moderator has supplied. |
(String) actor | When type equals kick|ban, this is the moderator which did the kick |
(Candy.Core.ChatUser) user | user which leaves the room |
Triggers on any recieved chatstate notification.
The resulting message object contains the name of the person, the roomJid, and the indicated chatstate.
(String) name | User name |
(String) roomJid | Room jid |
(String) chatstate | Chatstate being indicated. (“paused”, “inactive”, “composing”, “gone”) |
Perhaps handle blank “active” as specified by XEP-0085?
Triggers on various message events (subject changed, private chat message, multi-user chat message).
The resulting message object can contain different key-value pairs as stated in the documentation of the parameters itself.
(String) name | Room name |
(String) body | Message text |
(String) type | Message type ([normal, chat, groupchat]) or ‘info’ which is used internally for displaying informational messages |
(Boolean) isNoConferenceRoomJid | if a 3rd-party client sends a direct message to this user (not via the room) then the username is the node and not the resource. This flag tells if this is the case. |
(String) roomJid | Room jid |
(Object) message | Depending on what kind of message, the object consists of different key-value pairs: |
(String) timestamp | Timestamp, only when it’s an offline message |
Streamline those events sent and rename the parameters.
Notify view that the login window should be displayed
self.Login = function( presetJid )
Acts on strophe status events and notifies view.
Connect: function( status )
Responds to a version request
Version: function( msg )
Acts on a presence event
Presence: function( msg )
Acts on a bookmarks event.
Bookmarks: function( msg )
Acts on a privacy list event and sets up the current privacy list of this user.
PrivacyList: function( msg )
Acts when a privacy list error has been received.
PrivacyListError: function( msg )
Acts on room, admin and server messages and notifies the view if required.
Message: function( msg )
Leaves a room and cleans up related data and notifies view.
Leave: function( msg )
Sets informations to rooms according to the disco info received.
Disco: function( msg )
Acts on various presence messages (room leaving, room joining, error presence) and notifies view.
Presence: function( msg )
Acts when a presence of type error has been retrieved.
PresenceError: function( msg )
Acts on various message events (subject changed, private chat message, multi-user chat message) and notifies view.
Message: function( msg )