72b7e4ec34
* Mark group as left = false if it is active in contact sync * Handle expireTimer + blocked state along with contact/group sync
29 lines
814 B
JavaScript
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));
|
|
};
|
|
})();
|