Commit 293ca2c7 authored by JC Brand's avatar JC Brand

Let the OTR code for adding a button mirror the spoiler way

parent 7bf157d9
...@@ -419,13 +419,10 @@ ...@@ -419,13 +419,10 @@
} }
}, },
renderToolbar (toolbar, options) { addOTRToolbarButton (options) {
const { _converse } = this.__super__, const { _converse } = this.__super__,
{ __ } = _converse; { __ } = _converse,
if (!_converse.show_toolbar) { data = this.model.toJSON();
return;
}
const data = this.model.toJSON();
options = _.extend(options || {}, { options = _.extend(options || {}, {
FINISHED, FINISHED,
UNENCRYPTED, UNENCRYPTED,
...@@ -443,13 +440,17 @@ ...@@ -443,13 +440,17 @@
otr_tooltip: this.getOTRTooltip(), otr_tooltip: this.getOTRTooltip(),
otr_translated_status: OTR_TRANSLATED_MAPPING[data.otr_status], otr_translated_status: OTR_TRANSLATED_MAPPING[data.otr_status],
}); });
this.__super__.renderToolbar.apply(this, arguments);
this.el.querySelector('.chat-toolbar').insertAdjacentHTML( this.el.querySelector('.chat-toolbar').insertAdjacentHTML(
'beforeend', 'beforeend',
tpl_toolbar_otr( tpl_toolbar_otr(
_.extend(this.model.toJSON(), options || {}) _.extend(this.model.toJSON(), options || {})
)); ));
return this; },
renderToolbar (toolbar, options) {
const result = this.__super__.renderToolbar.apply(this, arguments);
this.addOTRToolbarButton(options);
return result;
} }
} }
}, },
......
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