Handle XMPP stuff.
- Source:
Namespaces
Members
-
<static> login
-
Create new connection or attach to old
- Source:
-
<static> login^2
-
Create new connection with given parameters.
- Source:
-
<static> login^3
-
Attach connection with given parameters.
- Source:
Methods
-
<private, static> _sendMessage(jid, msg, uid)
-
Create message stanza and send it.
Parameters:
Name Type Description jid
Jabber id msg
Message uid
unique id - Source:
-
<static> addBuddy(username, alias)
-
Add buddy to my friends
Parameters:
Name Type Description username
string jid alias
string - Source:
-
<private, static> attached()
-
Triggered if connection is attached
- Source:
-
<private, static> connected()
-
Triggered if connection is established
- Source:
-
<private, static> disconnected()
-
Triggered if lost connection
- Source:
-
<static> getCapabilitiesByJid(jid)
-
Retrieves capabilities.
Parameters:
Name Type Description jid
- Source:
Returns:
List of known capabilities -
<static> hasFeatureByJid(jid, feature, cb) → {boolean}
-
Test if jid has given features
Parameters:
Name Type Description jid
string Jabber id feature
string[] Single feature or list of features cb
function Called with the result as first param. - Source:
Returns:
True, if jid has all given features. Null, if we do not know it currently.- Type
- boolean
-
<static> loadVcard(bid, cb, error_cb)
-
This function loads a vcard.
Parameters:
Name Type Description bid
cb
error_cb
- Source:
-
<static> logout(complete) → {Boolean}
-
Logs user out of his xmpp session and does some clean up.
Parameters:
Name Type Description complete
boolean If set to false, roster will not be removed - Source:
Returns:
- Type
- Boolean
-
<private, static> onAuthFail()
-
Triggered on auth fail.
- Source:
-
<private, static> onConnfail(condition)
-
Triggered on connection fault
Parameters:
Name Type Description condition
String information why we lost the connection - Source:
-
<private, static> onMessage(presence) → {Boolean}
-
Triggered on incoming message stanzas
Parameters:
Name Type Description presence
dom - Source:
Returns:
- Type
- Boolean
-
<private, static> onPresence(presence)
-
Triggered on incoming presence stanzas
Parameters:
Name Type Description presence
dom - Source:
-
<private, static> onRidChange(rid)
-
Triggerd if the rid changed
Parameters:
Name Type Description rid
integer next valid request id - Source:
-
<private, static> onRoster(iq)
-
Triggered on initial roster load
Parameters:
Name Type Description iq
dom - Source:
-
<private, static> onRosterChanged(iq) → {Boolean}
-
Triggerd on roster changes
Parameters:
Name Type Description iq
dom - Source:
Returns:
True to preserve handler- Type
- Boolean
-
<static> removeBuddy(jid)
-
Remove buddy from my friends
Parameters:
Name Type Description jid
type - Source:
-
<static> resFriendReq(from, approve)
-
response to friendship request
Parameters:
Name Type Description from
string jid from original friendship req approve
boolean - Source:
-
<static> sendMessage(bid, msg, uid)
-
Public function to send message.
Parameters:
Name Type Description bid
css jid of user msg
message uid
unique id - Source:
-
<static> sendPres()
-
Sends presence stanza to server.
- Source: