Blocking/Unblocking improvements for message requests

This commit is contained in:
Josh Perez 2020-09-01 16:56:37 -04:00 committed by Josh Perez
parent 91ea69133b
commit 9eeb68a9a7
5 changed files with 33 additions and 73 deletions

View file

@ -2101,18 +2101,10 @@
}
if (typeof details.blocked !== 'undefined') {
const e164 = conversation.get('e164');
if (details.blocked && e164) {
storage.addBlockedNumber(e164);
if (details.blocked) {
conversation.block();
} else {
storage.removeBlockedNumber(e164);
}
const uuid = conversation.get('uuid');
if (details.blocked && uuid) {
storage.addBlockedUuid(uuid);
} else {
storage.removeBlockedUuid(uuid);
conversation.unblock();
}
}
@ -2233,9 +2225,9 @@
}
if (details.blocked) {
storage.addBlockedGroup(id);
conversation.block();
} else {
storage.removeBlockedGroup(id);
conversation.unblock();
}
conversation.set(updates);