Commit 8db839b4 authored by JC Brand's avatar JC Brand

Send a XEP-0410 ping when we restore a MUC from cache

and re-enter if necessary.

This solves the problem where we "clone" a tab (e.g. middle-click) and
then restore a MUC from cache which we haven't actually entered (given
that the new tab represents a new device and session).

Also... add `await` in a test to try and fix Travis flakiness
parent 836d3946
......@@ -290,7 +290,7 @@
test_utils.openControlBox();
const room_jid = 'kitchen@conference.shakespeare.lit';
await test_utils.waitUntil(() => !_.isUndefined(_converse.rooms_list_view), 500);
await test_utils.openAndEnterChatRoom(_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo');
await test_utils.openAndEnterChatRoom(_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo');
const view = _converse.chatboxviews.get(room_jid);
view.model.set({'minimized': true});
const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit';
......@@ -303,8 +303,11 @@
type: 'groupchat'
}).c('body').t('foo').tree());
const lview = _converse.rooms_list_view
await test_utils.waitUntil(() => lview.el.querySelectorAll(".available-chatroom").length);
// If the user isn't mentioned, the counter doesn't get incremented, but the text of the groupchat is bold
let room_el = _converse.rooms_list_view.el.querySelector(".available-chatroom");
let room_el = lview.el.querySelector(".available-chatroom");
expect(_.includes(room_el.classList, 'unread-msgs')).toBeTruthy();
// If the user is mentioned, the counter also gets updated
......
......@@ -310,7 +310,7 @@ converse.plugins.add('converse-muc', {
return;
}
this.join();
} else {
} else if (!(await this.rejoinIfNecessary())) {
this.features.fetch();
this.fetchMessages();
}
......
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