Passive UUID support
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
f64ca0ed21
commit
a90246cbe5
49 changed files with 2226 additions and 776 deletions
|
@ -5,6 +5,7 @@
|
|||
'use strict';
|
||||
|
||||
const BLOCKED_NUMBERS_ID = 'blocked';
|
||||
const BLOCKED_UUIDS_ID = 'blocked-uuids';
|
||||
const BLOCKED_GROUPS_ID = 'blocked-groups';
|
||||
|
||||
storage.isBlocked = number => {
|
||||
|
@ -31,6 +32,30 @@
|
|||
storage.put(BLOCKED_NUMBERS_ID, _.without(numbers, number));
|
||||
};
|
||||
|
||||
storage.isUuidBlocked = uuid => {
|
||||
const uuids = storage.get(BLOCKED_UUIDS_ID, []);
|
||||
|
||||
return _.include(uuids, uuid);
|
||||
};
|
||||
storage.addBlockedUuid = uuid => {
|
||||
const uuids = storage.get(BLOCKED_UUIDS_ID, []);
|
||||
if (_.include(uuids, uuid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.log.info('adding', uuid, 'to blocked list');
|
||||
storage.put(BLOCKED_UUIDS_ID, uuids.concat(uuid));
|
||||
};
|
||||
storage.removeBlockedUuid = uuid => {
|
||||
const numbers = storage.get(BLOCKED_UUIDS_ID, []);
|
||||
if (!_.include(numbers, uuid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.log.info('removing', uuid, 'from blocked list');
|
||||
storage.put(BLOCKED_NUMBERS_ID, _.without(numbers, uuid));
|
||||
};
|
||||
|
||||
storage.isGroupBlocked = groupId => {
|
||||
const groupIds = storage.get(BLOCKED_GROUPS_ID, []);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue