"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "js/models/blockedNumbers.js" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

blockedNumbers.js  (Signal-Desktop-1.35.2):blockedNumbers.js  (Signal-Desktop-1.36.1)
/* global storage, _ */ /* global storage, _ */
// eslint-disable-next-line func-names // eslint-disable-next-line func-names
(function() { (function() {
'use strict';
const BLOCKED_NUMBERS_ID = 'blocked'; const BLOCKED_NUMBERS_ID = 'blocked';
const BLOCKED_UUIDS_ID = 'blocked-uuids'; const BLOCKED_UUIDS_ID = 'blocked-uuids';
const BLOCKED_GROUPS_ID = 'blocked-groups'; const BLOCKED_GROUPS_ID = 'blocked-groups';
storage.isBlocked = number => { storage.isBlocked = number => {
const numbers = storage.get(BLOCKED_NUMBERS_ID, []); const numbers = storage.get(BLOCKED_NUMBERS_ID, []);
return _.include(numbers, number); return _.include(numbers, number);
}; };
storage.addBlockedNumber = number => { storage.addBlockedNumber = number => {
skipping to change at line 70 skipping to change at line 68
const groupIds = storage.get(BLOCKED_GROUPS_ID, []); const groupIds = storage.get(BLOCKED_GROUPS_ID, []);
return _.include(groupIds, groupId); return _.include(groupIds, groupId);
}; };
storage.addBlockedGroup = groupId => { storage.addBlockedGroup = groupId => {
const groupIds = storage.get(BLOCKED_GROUPS_ID, []); const groupIds = storage.get(BLOCKED_GROUPS_ID, []);
if (_.include(groupIds, groupId)) { if (_.include(groupIds, groupId)) {
return; return;
} }
window.log.info(`adding groupId(${groupId}) to blocked list`); window.log.info(`adding group(${groupId}) to blocked list`);
storage.put(BLOCKED_GROUPS_ID, groupIds.concat(groupId)); storage.put(BLOCKED_GROUPS_ID, groupIds.concat(groupId));
}; };
storage.removeBlockedGroup = groupId => { storage.removeBlockedGroup = groupId => {
const groupIds = storage.get(BLOCKED_GROUPS_ID, []); const groupIds = storage.get(BLOCKED_GROUPS_ID, []);
if (!_.include(groupIds, groupId)) { if (!_.include(groupIds, groupId)) {
return; return;
} }
window.log.info(`removing group(${groupId} from blocked list`); window.log.info(`removing group(${groupId} from blocked list`);
storage.put(BLOCKED_GROUPS_ID, _.without(groupIds, groupId)); storage.put(BLOCKED_GROUPS_ID, _.without(groupIds, groupId));
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)