|
@@ -182,7 +182,6 @@ export function onRosterContactsFetched () {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Reject or cancel another user's subscription to our presence updates.
|
|
* Reject or cancel another user's subscription to our presence updates.
|
|
* @function rejectPresenceSubscription
|
|
* @function rejectPresenceSubscription
|
|
@@ -195,7 +194,6 @@ export function rejectPresenceSubscription (jid, message) {
|
|
api.send(pres);
|
|
api.send(pres);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
export function contactsComparator (contact1, contact2) {
|
|
export function contactsComparator (contact1, contact2) {
|
|
const status1 = contact1.presence.get('show') || 'offline';
|
|
const status1 = contact1.presence.get('show') || 'offline';
|
|
const status2 = contact2.presence.get('show') || 'offline';
|
|
const status2 = contact2.presence.get('show') || 'offline';
|
|
@@ -208,7 +206,6 @@ export function contactsComparator (contact1, contact2) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
export function groupsComparator (a, b) {
|
|
export function groupsComparator (a, b) {
|
|
const HEADER_WEIGHTS = {};
|
|
const HEADER_WEIGHTS = {};
|
|
HEADER_WEIGHTS[_converse.HEADER_UNREAD] = 0;
|
|
HEADER_WEIGHTS[_converse.HEADER_UNREAD] = 0;
|
|
@@ -233,3 +230,9 @@ export function groupsComparator (a, b) {
|
|
return WEIGHTS[a] < WEIGHTS[b_header] ? -1 : (WEIGHTS[a] > WEIGHTS[b_header] ? 1 : 0);
|
|
return WEIGHTS[a] < WEIGHTS[b_header] ? -1 : (WEIGHTS[a] > WEIGHTS[b_header] ? 1 : 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+export function getGroupsAutoCompleteList () {
|
|
|
|
+ const { roster } = _converse;
|
|
|
|
+ const groups = roster.reduce((groups, contact) => groups.concat(contact.get('groups')), []);
|
|
|
|
+ return [...new Set(groups.filter(i => i))];
|
|
|
|
+}
|