JSDoc: Namespace: xmpp

# Namespace: xmpp

## jsxc. xmpp

Handle XMPP stuff.

Source:
  - jsxc.lib.xmpp.js, line 1

### Namespaces

bookmarks
carbons

### Members

#### <static> login

  Create new connection or attach to old
  Source:
    - jsxc.lib.xmpp.js, line 9

#### <static> login^2

  Create new connection with given parameters.
  Source:
    - jsxc.lib.xmpp.js, line 10

#### <static> login^3

  Attach connection with given parameters.
  Source:
    - jsxc.lib.xmpp.js, line 11

### 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:
    - jsxc.lib.xmpp.js, line 1027

#### <static> addBuddy(username, alias)

  Add buddy to my friends

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `username` | string | jid
  `alias` | string |

  Source:
    - jsxc.lib.xmpp.js, line 937

#### <private, static> attached()

  Triggered if connection is attached
  Source:
    - jsxc.lib.xmpp.js, line 278

#### <private, static> connected()

  Triggered if connection is established
  Source:
    - jsxc.lib.xmpp.js, line 245

#### <private, static> disconnected()

  Triggered if lost connection
  Source:
    - jsxc.lib.xmpp.js, line 419

#### <static> getCapabilitiesByJid(jid)

  Retrieves capabilities.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jid` |  |

  Source:
    - jsxc.lib.xmpp.js, line 1085

  ##### 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:
    - jsxc.lib.xmpp.js, line 1108

  ##### 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:
    - jsxc.lib.xmpp.js, line 1062

#### <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:
    - jsxc.lib.xmpp.js, line 179

  ##### Returns:

  Type
    Boolean

#### <private, static> onAuthFail()

  Triggered on auth fail.
  Source:
    - jsxc.lib.xmpp.js, line 472

#### <private, static> onConnfail(condition)

  Triggered on connection fault

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `condition` | String | information why we lost the connection

  Source:
    - jsxc.lib.xmpp.js, line 459

#### <private, static> onMessage(presence) → {Boolean}

  Triggered on incoming message stanzas

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `presence` | dom |

  Source:
    - jsxc.lib.xmpp.js, line 769

  ##### Returns:

  Type
    Boolean

#### <private, static> onPresence(presence)

  Triggered on incoming presence stanzas

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `presence` | dom |

  Source:
    - jsxc.lib.xmpp.js, line 621

#### <private, static> onRidChange(rid)

  Triggerd if the rid changed

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `rid` | integer | next valid request id

  Source:
    - jsxc.lib.xmpp.js, line 906

#### <private, static> onRoster(iq)

  Triggered on initial roster load

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `iq` | dom |

  Source:
    - jsxc.lib.xmpp.js, line 495

#### <private, static> onRosterChanged(iq) → {Boolean}

  Triggerd on roster changes

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `iq` | dom |

  Source:
    - jsxc.lib.xmpp.js, line 547

  ##### Returns:

  True to preserve handler
  Type
    Boolean

#### <static> removeBuddy(jid)

  Remove buddy from my friends

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `jid` | type |

  Source:
    - jsxc.lib.xmpp.js, line 972

#### <static> resFriendReq(from, approve)

  response to friendship request

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `from` | string | jid from original friendship req
  `approve` | boolean |

  Source:
    - jsxc.lib.xmpp.js, line 916

#### <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:
    - jsxc.lib.xmpp.js, line 1010

#### <static> sendPres()

  Sends presence stanza to server.
  Source:
    - jsxc.lib.xmpp.js, line 384