Provide error output to user when encrypted message can't be sent
updates #497
This commit is contained in:
parent
7692a46e17
commit
b17579501f
@ -397,13 +397,21 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
sendMessage (attrs) {
|
sendMessage (attrs) {
|
||||||
const { _converse } = this.__super__;
|
const { _converse } = this.__super__,
|
||||||
|
{ __ } = _converse;
|
||||||
if (this.get('omemo_active')) {
|
if (this.get('omemo_active')) {
|
||||||
const message = this.messages.create(attrs);
|
const message = this.messages.create(attrs);
|
||||||
this.getBundlesAndBuildSessions()
|
this.getBundlesAndBuildSessions()
|
||||||
.then(devices => this.createOMEMOMessageStanza(message, devices))
|
.then(devices => this.createOMEMOMessageStanza(message, devices))
|
||||||
.then(stanza => this.sendMessageStanza(stanza))
|
.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 {
|
} else {
|
||||||
return this.__super__.sendMessage.apply(this, arguments);
|
return this.__super__.sendMessage.apply(this, arguments);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user