You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Merge pull request #554 from uhoreg/e2e_redact
don't try to decrypt a redacted message (fixes vector-im/riot-web#3744)
This commit is contained in:
@@ -769,6 +769,15 @@ Crypto.prototype.encryptEvent = function(event, room) {
|
|||||||
* is a problem decrypting the event.
|
* is a problem decrypting the event.
|
||||||
*/
|
*/
|
||||||
Crypto.prototype.decryptEvent = function(event) {
|
Crypto.prototype.decryptEvent = function(event) {
|
||||||
|
if (event.isRedacted()) {
|
||||||
|
return Promise.resolve({
|
||||||
|
clearEvent: {
|
||||||
|
room_id: event.getRoomId(),
|
||||||
|
type: "m.room.message",
|
||||||
|
content: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
const content = event.getWireContent();
|
const content = event.getWireContent();
|
||||||
const alg = this._getRoomDecryptor(event.getRoomId(), content.algorithm);
|
const alg = this._getRoomDecryptor(event.getRoomId(), content.algorithm);
|
||||||
return alg.decryptEvent(event);
|
return alg.decryptEvent(event);
|
||||||
|
|||||||
Reference in New Issue
Block a user