diff --git a/docs/CHANGES.md b/docs/CHANGES.md index efec1722f..a483721e5 100755 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -18,6 +18,7 @@ initialization is complete. [jcbrand] - New event ['reconnecting'](https://conversejs.org/docs/html/development.html#reconnecting) [jcbrand] - New configuration setting [allow_bookmarks](https://conversejs.org/docs/html/configuration.html#allow_bookmarks) [jcbrand] +- The `rooms.open` API method will no longer maximize rooms that are minimized (unless `maximize: true` is passed in). [jcbrand] ## 2.0.1 (2016-11-07) - #203 New configuration setting [muc_domain](https://conversejs.org/docs/html/configuration.html#muc_domain) [jcbrand] diff --git a/docs/source/developer_api.rst b/docs/source/developer_api.rst index d6e293be2..c25e15f61 100644 --- a/docs/source/developer_api.rst +++ b/docs/source/developer_api.rst @@ -578,6 +578,8 @@ Room attributes that may be passed in: For a list of configuration values that can be passed in, refer to these values in the `XEP-0045 MUC specification `_. The values should be named without the ``muc#roomconfig_`` prefix. +* *maximize*: A boolean, indicating whether minimized rooms should also be + maximized, when opened. Set to ``false`` by default. For example, opening a room with a specific default configuration: diff --git a/src/converse-minimize.js b/src/converse-minimize.js index c7a1e45a8..ccf4da03d 100644 --- a/src/converse-minimize.js +++ b/src/converse-minimize.js @@ -196,7 +196,8 @@ /* Find the chat box and show it. If it doesn't exist, create it. */ var chatbox = this.__super__.showChat.apply(this, arguments); - if (chatbox.get('minimized')) { + var maximize = _.isUndefined(attrs.maximize) ? true : attrs.maximize; + if (chatbox.get('minimized') && maximize) { chatbox.maximize(); } return chatbox; diff --git a/src/converse-muc.js b/src/converse-muc.js index f5a90abe6..c8e7d48d4 100755 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -1830,6 +1830,9 @@ } else if (typeof attrs === "undefined") { attrs = {}; } + if (_.isUndefined(attrs.maximize)) { + attrs.maximize = false; + } var fetcher = converse.chatboxviews.showChat.bind(converse.chatboxviews); if (!attrs.nick && converse.muc_nickname_from_jid) { attrs.nick = Strophe.getNodeFromJid(converse.bare_jid);