Don't show MUC domain if locked_muc_domain is set to 'hidden'

This commit is contained in:
JC Brand 2019-03-27 13:13:07 +01:00
parent fb89148b08
commit 616731b323
4 changed files with 20 additions and 4 deletions

13
dist/converse.js vendored
View File

@ -54467,6 +54467,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins
/* Returns the heading HTML to be rendered.
*/
return templates_chatroom_head_html__WEBPACK_IMPORTED_MODULE_16___default()(_.extend(this.model.toJSON(), {
'_converse': _converse,
'Strophe': Strophe,
'info_close': __('Close and leave this groupchat'),
'info_configure': __('Configure this groupchat'),
@ -93495,12 +93496,20 @@ var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./no
module.exports = function(o) {
var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
__p += '<!-- src/templates/chatroom_head.html -->\n<div class="chatbox-navback"><i class="fa fa-arrow-left"></i></div>\n<div class="chatbox-title">\n <div class="chat-title" title="' +
__p += '<!-- src/templates/chatroom_head.html -->\n<div class="chatbox-navback"><i class="fa fa-arrow-left"></i></div>\n<div class="chatbox-title">\n <div class="chat-title" ';
if (o._converse.locked_muc_domain !== 'hidden') { ;
__p += ' title="' +
__e(o.jid) +
'">\n ';
'" ';
} ;
__p += ' >\n ';
if (o.name && o.name !== o.Strophe.getNodeFromJid(o.jid)) { ;
__p += '\n ' +
__e( o.name ) +
'\n ';
} else if (o._converse.locked_muc_domain === 'hidden') { ;
__p += '\n ' +
__e( o.Strophe.getNodeFromJid(o.jid) ) +
'\n ';
} else { ;
__p += '\n ' +

View File

@ -882,10 +882,14 @@ locked_muc_domain
-----------------
* Default: ``false``
* Allowed values: ``false``, ``true``, ``'hidden'``
This setting allows you to restrict the multi-user chat (MUC) domain to only the value
By setting this value to something truthy, you restrict the multi-user chat (MUC) domain to only the value
specified in `muc_domain`_.
If the value is set to `'hidden'` (which is also truthy), then the MUC domain
will not be shown to users.
locked_muc_nickname
-------------------

View File

@ -694,6 +694,7 @@ converse.plugins.add('converse-muc-views', {
*/
return tpl_chatroom_head(
_.extend(this.model.toJSON(), {
'_converse': _converse,
'Strophe': Strophe,
'info_close': __('Close and leave this groupchat'),
'info_configure': __('Configure this groupchat'),

View File

@ -1,8 +1,10 @@
<div class="chatbox-navback"><i class="fa fa-arrow-left"></i></div>
<div class="chatbox-title">
<div class="chat-title" title="{{{o.jid}}}">
<div class="chat-title" {[ if (o._converse.locked_muc_domain !== 'hidden') { ]} title="{{{o.jid}}}" {[ } ]} >
{[ if (o.name && o.name !== o.Strophe.getNodeFromJid(o.jid)) { ]}
{{{ o.name }}}
{[ } else if (o._converse.locked_muc_domain === 'hidden') { ]}
{{{ o.Strophe.getNodeFromJid(o.jid) }}}
{[ } else { ]}
{{{ o.Strophe.getNodeFromJid(o.jid) }}}@{{{ o.Strophe.getDomainFromJid(o.jid) }}}
{[ } ]}