Ensure that blocked messages are dropped even after sealed sender
This commit is contained in:
parent
51f1ef5725
commit
91ef39e482
1 changed files with 16 additions and 2 deletions
|
@ -725,6 +725,13 @@ MessageReceiver.prototype.extend({
|
||||||
return { isMe: true };
|
return { isMe: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isBlocked(sender.getName())) {
|
||||||
|
window.log.info(
|
||||||
|
'Dropping blocked message after sealed sender decryption'
|
||||||
|
);
|
||||||
|
return { isBlocked: true };
|
||||||
|
}
|
||||||
|
|
||||||
// Here we take this sender information and attach it back to the envelope
|
// Here we take this sender information and attach it back to the envelope
|
||||||
// to make the rest of the app work properly.
|
// to make the rest of the app work properly.
|
||||||
|
|
||||||
|
@ -747,6 +754,13 @@ MessageReceiver.prototype.extend({
|
||||||
if (sender) {
|
if (sender) {
|
||||||
const originalSource = envelope.source;
|
const originalSource = envelope.source;
|
||||||
|
|
||||||
|
if (this.isBlocked(sender.getName())) {
|
||||||
|
window.log.info(
|
||||||
|
'Dropping blocked message with error after sealed sender decryption'
|
||||||
|
);
|
||||||
|
return { isBlocked: true };
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
envelope.source = sender.getName();
|
envelope.source = sender.getName();
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
@ -769,8 +783,8 @@ MessageReceiver.prototype.extend({
|
||||||
|
|
||||||
return promise
|
return promise
|
||||||
.then(plaintext => {
|
.then(plaintext => {
|
||||||
const { isMe } = plaintext || {};
|
const { isMe, isBlocked } = plaintext || {};
|
||||||
if (isMe) {
|
if (isMe || isBlocked) {
|
||||||
return this.removeFromCache(envelope);
|
return this.removeFromCache(envelope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue