Converse converse.js

Namespace: muc_utils

muc_utils

The MUC utils object. Contains utility functions related to multi-user chat.

Source:

Methods

(private) computeAffiliationsDelta(exclude_existing, remove_absentees, new_list, old_list) → {array}

Given two lists of objects with 'jid', 'affiliation' and 'reason' properties, return a new list containing those objects that are new, changed or removed (depending on the 'remove_absentees' boolean).

The affiliations for new and changed members stay the same, for removed members, the affiliation is set to 'none'.

The 'reason' property is not taken into account when comparing whether affiliations have been changed.

Parameters:
Name Type Description
exclude_existing boolean

Indicates whether JIDs from the new list which are also in the old list (regardless of affiliation) should be excluded from the delta. One reason to do this would be when you want to add a JID only if it doesn't have any existing affiliation at all.

remove_absentees boolean

Indicates whether JIDs from the old list which are not in the new list should be considered removed and therefore be included in the delta with affiliation set to 'none'.

new_list array

Array containing the new affiliations

old_list array

Array containing the old affiliations

Source:
Returns:
Type
array

(private) parseMemberListIQ() → {Array.<MemberListItem>}

Given an IQ stanza with a member list, create an array of objects containing known member data (e.g. jid, nick, role, affiliation).

Source:
Returns:
Type
Array.<MemberListItem>