Candy | Chats are not dead yet. |
© 2011 Amiado Group AG. All rights reserved. © 2012-2014 Patrick Stadler & Michael Weibel. All rights reserved.
chatUser.js | |
Candy. | Chat User |
Constants | |
ROLE_MODERATOR | Moderator role |
AFFILIATION_OWNER | Affiliation owner |
Variables | |
data | |
Functions | |
getJid | Gets an unescaped user jid |
getEscapedJid | Escapes the user’s jid (node & resource get escaped) |
setJid | Sets a user’s jid |
getNick | Gets user nick |
setNick | Sets a user’s nick |
getRole | Gets user role |
setRole | Sets user role |
setAffiliation | Sets user affiliation |
getAffiliation | Gets user affiliation |
isModerator | Check if user is moderator. |
addToOrRemoveFromPrivacyList | Convenience function for adding/removing users from ignore list. |
getPrivacyList | Returns the privacy list of the listname of the param. |
setPrivacyLists | Sets privacy lists. |
isInPrivacyList | Tests if this user ignores the user provided by jid. |
setCustomData | Stores custom data |
getCustomData | Retrieve custom data |
setPreviousNick | If user has nickname changed, set previous nickname. |
hasNicknameChanged | Gets the previous nickname if available. |
Chat User
Constants | |
ROLE_MODERATOR | Moderator role |
AFFILIATION_OWNER | Affiliation owner |
Variables | |
data | |
Functions | |
getJid | Gets an unescaped user jid |
getEscapedJid | Escapes the user’s jid (node & resource get escaped) |
setJid | Sets a user’s jid |
getNick | Gets user nick |
setNick | Sets a user’s nick |
getRole | Gets user role |
setRole | Sets user role |
setAffiliation | Sets user affiliation |
getAffiliation | Gets user affiliation |
isModerator | Check if user is moderator. |
addToOrRemoveFromPrivacyList | Convenience function for adding/removing users from ignore list. |
getPrivacyList | Returns the privacy list of the listname of the param. |
setPrivacyLists | Sets privacy lists. |
isInPrivacyList | Tests if this user ignores the user provided by jid. |
setCustomData | Stores custom data |
getCustomData | Retrieve custom data |
setPreviousNick | If user has nickname changed, set previous nickname. |
hasNicknameChanged | Gets the previous nickname if available. |
this.addToOrRemoveFromPrivacyList = function( list, jid )
Convenience function for adding/removing users from ignore list.
Check if user is already in privacy list. If yes, remove it. If no, add it.
(String) list | To which privacy list the user should be added / removed from. Candy supports curently only the “ignore” list. |
(String) jid | User jid to add/remove |
(Array) | Current privacy list. |
this.data
Gets an unescaped user jid
this.getJid = function()
Escapes the user’s jid (node & resource get escaped)
this.getEscapedJid = function()
Sets a user’s jid
this.setJid = function( jid )
Gets user nick
this.getNick = function()
Sets a user’s nick
this.setNick = function( nick )
Gets user role
this.getRole = function()
Sets user role
this.setRole = function( role )
Sets user affiliation
this.setAffiliation = function( affiliation )
Gets user affiliation
this.getAffiliation = function()
Check if user is moderator.
this.isModerator = function()
Convenience function for adding/removing users from ignore list.
this.addToOrRemoveFromPrivacyList = function( list, jid )
Returns the privacy list of the listname of the param.
this.getPrivacyList = function( list )
Sets privacy lists.
this.setPrivacyLists = function( lists )
Tests if this user ignores the user provided by jid.
this.isInPrivacyList = function( list, jid )
Stores custom data
this.setCustomData = function( data )
Retrieve custom data
this.getCustomData = function()
If user has nickname changed, set previous nickname.
this.setPreviousNick = function( previousNick )
Unescapes a jid (node & resource get unescaped)
self.unescapeJid = function( jid )
Escapes a jid (node & resource get escaped)
self.escapeJid = function( jid )