"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "js/modules/privacy.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).

privacy.js  (Signal-Desktop-1.35.2):privacy.js  (Signal-Desktop-1.36.1)
skipping to change at line 13 skipping to change at line 13
const is = require('@sindresorhus/is'); const is = require('@sindresorhus/is');
const path = require('path'); const path = require('path');
const { compose } = require('lodash/fp'); const { compose } = require('lodash/fp');
const { escapeRegExp } = require('lodash'); const { escapeRegExp } = require('lodash');
const APP_ROOT_PATH = path.join(__dirname, '..', '..', '..'); const APP_ROOT_PATH = path.join(__dirname, '..', '..', '..');
const PHONE_NUMBER_PATTERN = /\+\d{7,12}(\d{3})/g; const PHONE_NUMBER_PATTERN = /\+\d{7,12}(\d{3})/g;
const UUID_PATTERN = /[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0- 9A-F]{9}([0-9A-F]{3})/gi; const UUID_PATTERN = /[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0- 9A-F]{9}([0-9A-F]{3})/gi;
const GROUP_ID_PATTERN = /(group\()([^)]+)(\))/g; const GROUP_ID_PATTERN = /(group\()([^)]+)(\))/g;
const GROUP_V2_ID_PATTERN = /(groupv2\()([^=)]+)(=?=?\))/g;
const REDACTION_PLACEHOLDER = '[REDACTED]'; const REDACTION_PLACEHOLDER = '[REDACTED]';
// _redactPath :: Path -> String -> String // _redactPath :: Path -> String -> String
exports._redactPath = filePath => { exports._redactPath = filePath => {
if (!is.string(filePath)) { if (!is.string(filePath)) {
throw new TypeError("'filePath' must be a string"); throw new TypeError("'filePath' must be a string");
} }
const filePathPattern = exports._pathToRegExp(filePath); const filePathPattern = exports._pathToRegExp(filePath);
skipping to change at line 83 skipping to change at line 84
return text.replace(UUID_PATTERN, `${REDACTION_PLACEHOLDER}$1`); return text.replace(UUID_PATTERN, `${REDACTION_PLACEHOLDER}$1`);
}; };
// redactGroupIds :: String -> String // redactGroupIds :: String -> String
exports.redactGroupIds = text => { exports.redactGroupIds = text => {
if (!is.string(text)) { if (!is.string(text)) {
throw new TypeError("'text' must be a string"); throw new TypeError("'text' must be a string");
} }
return text.replace( return text
GROUP_ID_PATTERN, .replace(
(match, before, id, after) => GROUP_ID_PATTERN,
`${before}${REDACTION_PLACEHOLDER}${removeNewlines(id).slice(-3)}${after}` (match, before, id, after) =>
); `${before}${REDACTION_PLACEHOLDER}${removeNewlines(id).slice(
-3
)}${after}`
)
.replace(
GROUP_V2_ID_PATTERN,
(match, before, id, after) =>
`${before}${REDACTION_PLACEHOLDER}${removeNewlines(id).slice(
-3
)}${after}`
);
}; };
// redactSensitivePaths :: String -> String // redactSensitivePaths :: String -> String
exports.redactSensitivePaths = exports._redactPath(APP_ROOT_PATH); exports.redactSensitivePaths = exports._redactPath(APP_ROOT_PATH);
// redactAll :: String -> String // redactAll :: String -> String
exports.redactAll = compose( exports.redactAll = compose(
exports.redactSensitivePaths, exports.redactSensitivePaths,
exports.redactGroupIds, exports.redactGroupIds,
exports.redactPhoneNumbers, exports.redactPhoneNumbers,
 End of changes. 2 change blocks. 
5 lines changed or deleted 16 lines changed or added

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