signal-desktop/js/models/blockedNumbers.js
Scott Nonnenberg 72b7e4ec34
Process expireTimer and block status along with contact/group sync (#1980)
* Mark group as left = false if it is active in contact sync

* Handle expireTimer + blocked state along with contact/group sync
2018-01-29 18:14:39 -08:00

29 lines
814 B
JavaScript

/*
* vim: ts=4:sw=4:expandtab
*/
(function () {
'use strict';
storage.isBlocked = function(number) {
var numbers = storage.get('blocked', []);
return _.include(numbers, number);
};
storage.addBlockedNumber = function(number) {
var numbers = storage.get('blocked', []);
if (_.include(numbers, number)) {
return;
}
console.log('adding', number, 'to blocked list');
storage.put('blocked', numbers.concat(number));
};
storage.removeBlockedNumber = function(number) {
var numbers = storage.get('blocked', []);
if (!_.include(numbers, number)) {
return;
}
console.log('removing', number, 'from blocked list');
storage.put('blocked', _.without(numbers, number));
};
})();