Rename hide_subject to subject_hidden

This commit is contained in:
JC Brand 2020-02-18 17:26:49 +01:00
parent ce08819a43
commit 5b5c4595cc
3 changed files with 5 additions and 5 deletions

View File

@ -1123,8 +1123,8 @@ converse.plugins.add('converse-muc-views', {
if (this.model.get('subject')) {
buttons.push({
'i18n_text': this.model.get('hide_subject') ? __('Show topic') : __('Hide topic'),
'i18n_title': this.model.get('hide_subject') ?
'i18n_text': this.model.get('subject_hidden') ? __('Show topic') : __('Hide topic'),
'i18n_title': this.model.get('subject_hidden') ?
__('Show the topic message in the heading') :
__('Hide the topic in the heading'),
'handler': ev => this.toggleTopic(ev),
@ -1171,7 +1171,7 @@ converse.plugins.add('converse-muc-views', {
},
toggleTopic () {
this.model.save('hide_subject', !this.model.get('hide_subject'));
this.model.save('subject_hidden', !this.model.get('subject_hidden'));
},

View File

@ -1568,7 +1568,7 @@ converse.plugins.add('converse-muc', {
// MUST NOT contain a <body/> element (or a <thread/> element).
u.safeSave(this, {
'subject': {'author': attrs.nick, 'text': attrs.subject || ''},
'hide_subject': attrs.subject ? false : this.get('hide_subject')
'subject_hidden': attrs.subject ? false : this.get('subject_hidden')
});
return true;
}

View File

@ -15,7 +15,7 @@ const tpl_standalone_btns = (o) => o.standalone_btns.reverse().map(b => until(b,
export default (o) => {
const subject = o.subject ? u.addHyperlinks(xss.filterXSS(o.subject.text, {'whiteList': {}})) : '';
const show_subject = (subject && !o.hide_subject);
const show_subject = (subject && !o.subject_hidden);
return html`
<div class="chatbox-title ${ show_subject ? '' : "chatbox-title--no-desc"}">
${ (o._converse.standalone) ? html`<div class="chatbox-navback"><i class="fa fa-arrow-left"></i></div>` : '' }