Commit a5513229 authored by JC Brand's avatar JC Brand

Work on showing auto_joined chatrooms

parent 1ce46a84
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* *
* NB: These plugins need to have already been loaded via require.js. * NB: These plugins need to have already been loaded via require.js.
*/ */
dependencies: ["converse-chatboxes", "converse-muc"], dependencies: ["converse-chatboxes", "converse-muc", "converse-muc-views"],
overrides: { overrides: {
// Overrides mentioned here will be picked up by converse.js's // Overrides mentioned here will be picked up by converse.js's
...@@ -269,7 +269,10 @@ ...@@ -269,7 +269,10 @@
openBookmarkedRoom (bookmark) { openBookmarkedRoom (bookmark) {
if (bookmark.get('autojoin')) { if (bookmark.get('autojoin')) {
_converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick')); const room = _converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick'));
if (!room.get('hidden')) {
room.trigger('show');
}
} }
return bookmark; return bookmark;
}, },
...@@ -566,6 +569,8 @@ ...@@ -566,6 +569,8 @@
]).then(initBookmarks) ]).then(initBookmarks)
.catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL)); .catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
_converse.on('reconnected', initBookmarks);
_converse.on('connected', () => { _converse.on('connected', () => {
// Add a handler for bookmarks pushed from other connected clients // Add a handler for bookmarks pushed from other connected clients
// (from the same user obviously) // (from the same user obviously)
...@@ -576,13 +581,6 @@ ...@@ -576,13 +581,6 @@
}, null, 'message', 'headline', null, _converse.bare_jid); }, null, 'message', 'headline', null, _converse.bare_jid);
}); });
const afterReconnection = function () {
if (!_converse.allow_bookmarks) {
return;
}
initBookmarks();
};
_converse.on('reconnected', afterReconnection);
} }
}); });
})); }));
...@@ -348,13 +348,11 @@ ...@@ -348,13 +348,11 @@
this.el.classList.add("col-xl-2"); this.el.classList.add("col-xl-2");
this.el.classList.add("col-md-3"); this.el.classList.add("col-md-3");
if (!this.controlbox_pane) {
this.controlbox_pane = new _converse.ControlBoxPane(); this.controlbox_pane = new _converse.ControlBoxPane();
this.el.querySelector('.controlbox-panes').insertAdjacentElement( this.el.querySelector('.controlbox-panes').insertAdjacentElement(
'afterBegin', 'afterBegin',
this.controlbox_pane.el this.controlbox_pane.el
) )
}
}, },
close (ev) { close (ev) {
......
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