JSDoc: Namespace: muc

# Namespace: muc

## jsxc. muc

Implements Multi-User Chat (XEP-0045).

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

### Members

#### <static> conn

  strophe connection
  Source:
    - jsxc.lib.muc.js, line 8

#### <static> CONST

  some constants
  Source:
    - jsxc.lib.muc.js, line 11

#### <static> helper :Object

  Some helper functions.

  ##### Type:

  - Object
  Source:
    - jsxc.lib.muc.js, line 1409

#### <static> onStatus

  Handle status codes. Every function gets room jid, nickname, member data and xdata.
  Source:
    - jsxc.lib.muc.js, line 891

### Methods

#### <private, static> _showRoomConfiguration(room, config)

  Show room configuration.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | room jid
  `config` | Strophe.x.Form | current room config as Form object

  Source:
    - jsxc.lib.muc.js, line 388

#### <static> close(room)

  Close the given room.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` |  | Room jid

  Source:
    - jsxc.lib.muc.js, line 557

#### <static> destroy(room, handler_cb, error_cb)

  Destroy the given room.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid
  `handler_cb` | function | Function to handle the successful destruction
  `error_cb` | function | Function to handle an error

  Source:
    - jsxc.lib.muc.js, line 526

#### <static> emptyMembers(room)

  Empty member list.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid

  Source:
    - jsxc.lib.muc.js, line 1222

#### <private, static> init(o)

  Initialize muc plugin.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `o` | object | Options

  Source:
    - jsxc.lib.muc.js, line 44

#### <static> initMenu()

  Add entry to menu.
  Source:
    - jsxc.lib.muc.js, line 105

#### <private, static> initWindow(event, win)

  Init group chat window.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  | Event
  `win` | jQuery | Window object

  Source:
    - jsxc.lib.muc.js, line 589

#### <static> insertMember(room, nickname, memberdata)

  Insert member to room member list.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid
  `nickname` | string | Nickname
  `memberdata` | string | Member data

  Source:
    - jsxc.lib.muc.js, line 1134

#### <static> join(room, nickname, password, roomName, subject)

  Join the given room.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `room` | string |  | Room jid
  `nickname` | string |  | Desired nickname
  `password` | string | <optional> | Password
  `roomName` | string | <optional> | Room alias
  `subject` | string | <optional> | Current subject

  Source:
    - jsxc.lib.muc.js, line 447

#### <static> leave(room)

  Leave given room.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid

  Source:
    - jsxc.lib.muc.js, line 476

#### <private, static> onAddRoster(event, room, data, bud)

  Prepare group chat roster item.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `room` | string | Room jid
  `data` | object | Room data
  `bud` | jQuery | Roster item

  Source:
    - jsxc.lib.muc.js, line 1353

#### <private, static> onErrorMessage(message)

  Handle group chat error message.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `message` | string | Message stanza

  Source:
    - jsxc.lib.muc.js, line 1305

#### <private, static> onExited(room)

  Clean up after we exited a room.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid

  Source:
    - jsxc.lib.muc.js, line 497

#### <private, static> onGroupchatMessage(message) → {boolean}

  Handle incoming group chat message.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `message` | string | Message stanza

  Source:
    - jsxc.lib.muc.js, line 1238

  ##### Returns:

  True on success
  Type
    boolean

#### <private, static> onPresence(event, from, status, presence)

  Triggered on incoming presence stanzas.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `from` | string | Jid
  `status` | integer | Online status between 0 and 5
  `presence` | string | Presence stanza

  Source:
    - jsxc.lib.muc.js, line 724

#### <static> onPresenceError(event, from, presence) → {Boolean}

  Handle group chat presence errors.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` |  |
  `from` | string | Jid
  `presence` | string | Presence stanza

  Source:
    - jsxc.lib.muc.js, line 867

  ##### Returns:

  Returns true on success
  Type
    Boolean

#### <static> postReason(room, xdata)

  Extract reason from xdata and if available post it to room.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid
  `xdata` | jQuery | Xdata

  Source:
    - jsxc.lib.muc.js, line 1099

#### <static> removeMember(room, nickname)

  Remove member from room member list.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid
  `nickname` | string | Nickname

  Source:
    - jsxc.lib.muc.js, line 1177

#### <static> scrollMemberListBy(room, offset)

  Scroll or update member list position.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | Room jid
  `offset` | integer | =0: update position; >0: Scroll to left; <0: Scroll to right

  Source:
    - jsxc.lib.muc.js, line 1193

#### <static> showJoinChat(r, p)

  Open join dialog.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `r` | string | <optional> | room jid
  `p` | string | <optional> | room password

  Source:
    - jsxc.lib.muc.js, line 120

#### <static> showRoomConfiguration(room)

  Request and show room configuration.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `room` | string | room jid

  Source:
    - jsxc.lib.muc.js, line 364