Skip to content

Commit

Permalink
make it configurable whether to respect autojoin
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosKid42 committed Mar 8, 2019
1 parent be156de commit ddb4320
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- #1437: List of groupchats in modal doesn't scroll
- #1457: Wrong tooltip shown for "unbookmark" icon
- #1479: Allow file upload by drag & drop also in MUCs
- #1487: New config option [muc_respect_autojoin](https://conversejs.org/docs/html/configuration.html#muc-respect-autojoin)


## 4.1.2 (2019-02-22)
Expand Down
5 changes: 3 additions & 2 deletions dist/converse.js
Original file line number Diff line number Diff line change
Expand Up @@ -48619,7 +48619,8 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
_converse.api.settings.update({
allow_bookmarks: true,
allow_public_bookmarks: false,
hide_open_bookmarks: true
hide_open_bookmarks: true,
muc_respect_autojoin: true
}); // Promises exposed by this plugin


Expand Down Expand Up @@ -48676,7 +48677,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
},

openBookmarkedRoom(bookmark) {
if (bookmark.get('autojoin')) {
if (_converse.muc_respect_autojoin && bookmark.get('autojoin')) {
const groupchat = _converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick'));

if (!groupchat.get('hidden')) {
Expand Down
10 changes: 10 additions & 0 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,16 @@ automatically be "john". If now john@differentdomain.com tries to join the
room, his nickname will be "john-2", and if john@somethingelse.com joins, then
his nickname will be "john-3", and so forth.

muc_respect_autojoin
--------------------

* Default; ``true``

Determines whether Converse will respect the autojoin-attribute of bookmarks. Per default
all MUCs with set autojoin flag in their respective bookmarks will be joined on
startup of Converse. When set to ``false`` no MUCs are automatically joined based on
their bookmarks.

muc_show_join_leave
-------------------

Expand Down
5 changes: 3 additions & 2 deletions src/converse-bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ converse.plugins.add('converse-bookmarks', {
_converse.api.settings.update({
allow_bookmarks: true,
allow_public_bookmarks: false,
hide_open_bookmarks: true
hide_open_bookmarks: true,
muc_respect_autojoin: true
});
// Promises exposed by this plugin
_converse.api.promises.add('bookmarksInitialized');
Expand Down Expand Up @@ -250,7 +251,7 @@ converse.plugins.add('converse-bookmarks', {
},

openBookmarkedRoom (bookmark) {
if (bookmark.get('autojoin')) {
if ( _converse.muc_respect_autojoin && bookmark.get('autojoin')) {
const groupchat = _converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick'));
if (!groupchat.get('hidden')) {
groupchat.trigger('show');
Expand Down

0 comments on commit ddb4320

Please sign in to comment.