Commit b172861d authored by laszlovl's avatar laszlovl Committed by JC Brand

Dont run fetchRosterContacts async, to prevent processing presence before contacts are created

Fixes #1405
parent 4a5603ab
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
- Accessibility: Tag the chat-content as an ARIA live region, for screen readers - Accessibility: Tag the chat-content as an ARIA live region, for screen readers
- Set releases URL to new Github repo - Set releases URL to new Github repo
- #1369 Don't wrongly interpret message with `subject` as a topic change. - #1369 Don't wrongly interpret message with `subject` as a topic change.
- #1405 Status of contacts list are not displayed properly
- #1408 new config option `roomconfig_whitelist` - #1408 new config option `roomconfig_whitelist`
- #1412 muc moderator commands can be disabled selectively by config - #1412 muc moderator commands can be disabled selectively by config
- #1413 fix moderator commands that change affiliation - #1413 fix moderator commands that change affiliation
......
...@@ -68022,11 +68022,15 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins ...@@ -68022,11 +68022,15 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
} }
} else { } else {
try { try {
await _converse.rostergroups.fetchRosterGroups().then(() => { /* Make sure not to run fetchRosterContacts async, since we need
* the contacts to exist before processing contacts presence,
* which might come in the same BOSH request.
*/
await _converse.rostergroups.fetchRosterGroups();
_converse.emit('rosterGroupsFetched'); _converse.emit('rosterGroupsFetched');
return _converse.roster.fetchRosterContacts(); await _converse.roster.fetchRosterContacts();
});
_converse.emit('rosterContactsFetched'); _converse.emit('rosterContactsFetched');
} catch (reason) { } catch (reason) {
...@@ -68375,8 +68379,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins ...@@ -68375,8 +68379,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
if (collection.length === 0 || this.rosterVersioningSupported() && !_converse.session.get('roster_fetched')) { if (collection.length === 0 || this.rosterVersioningSupported() && !_converse.session.get('roster_fetched')) {
_converse.send_initial_presence = true; _converse.send_initial_presence = true;
await _converse.roster.fetchFromServer();
_converse.roster.fetchFromServer();
} else { } else {
_converse.emit('cachedRoster', collection); _converse.emit('cachedRoster', collection);
} }
...@@ -88,10 +88,14 @@ converse.plugins.add('converse-roster', { ...@@ -88,10 +88,14 @@ converse.plugins.add('converse-roster', {
} }
} else { } else {
try { try {
await _converse.rostergroups.fetchRosterGroups().then(() => { /* Make sure not to run fetchRosterContacts async, since we need
* the contacts to exist before processing contacts presence,
* which might come in the same BOSH request.
*/
await _converse.rostergroups.fetchRosterGroups();
_converse.emit('rosterGroupsFetched'); _converse.emit('rosterGroupsFetched');
return _converse.roster.fetchRosterContacts();
}); await _converse.roster.fetchRosterContacts();
_converse.emit('rosterContactsFetched'); _converse.emit('rosterContactsFetched');
} catch (reason) { } catch (reason) {
_converse.log(reason, Strophe.LogLevel.ERROR); _converse.log(reason, Strophe.LogLevel.ERROR);
...@@ -403,7 +407,7 @@ converse.plugins.add('converse-roster', { ...@@ -403,7 +407,7 @@ converse.plugins.add('converse-roster', {
if (collection.length === 0 || if (collection.length === 0 ||
(this.rosterVersioningSupported() && !_converse.session.get('roster_fetched'))) { (this.rosterVersioningSupported() && !_converse.session.get('roster_fetched'))) {
_converse.send_initial_presence = true; _converse.send_initial_presence = true;
_converse.roster.fetchFromServer(); await _converse.roster.fetchFromServer();
} else { } else {
_converse.emit('cachedRoster', collection); _converse.emit('cachedRoster', collection);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment