Commit b1757950 authored by JC Brand's avatar JC Brand

Provide error output to user when encrypted message can't be sent

updates #497
parent 7692a46e
......@@ -397,13 +397,21 @@
},
sendMessage (attrs) {
const { _converse } = this.__super__;
const { _converse } = this.__super__,
{ __ } = _converse;
if (this.get('omemo_active')) {
const message = this.messages.create(attrs);
this.getBundlesAndBuildSessions()
.then(devices => this.createOMEMOMessageStanza(message, devices))
.then(stanza => this.sendMessageStanza(stanza))
.catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
.catch((e) => {
this.messages.create({
'message': __("Sorry, could not send the message due to an error.") + ` ${e.message}`,
'type': 'error',
});
converse.log(e, Strophe.LogLevel.ERROR);
});
} else {
return this.__super__.sendMessage.apply(this, arguments);
}
......
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