This commit is contained in:
Mikunj 2020-02-19 13:30:10 +11:00
parent a03185248c
commit d00abed7da
2 changed files with 7 additions and 2 deletions

View File

@ -131,7 +131,8 @@
if (deviceMapping.isPrimary === '0') {
const { primaryDevicePubKey } =
authorisations.find(
authorisation => authorisation && authorisation.secondaryDevicePubKey === pubKey
authorisation =>
authorisation && authorisation.secondaryDevicePubKey === pubKey
) || {};
if (primaryDevicePubKey) {
// do NOT call getprimaryDeviceMapping recursively

View File

@ -1475,7 +1475,11 @@ MessageReceiver.prototype.extend({
const ourOtherDevices = await libloki.storage.getAllDevicePubKeysForPrimaryPubKey(
window.storage.get('primaryDevicePubKey')
);
const ourDevices = new Set([ourNumber, ourPrimaryNumber, ...ourOtherDevices]);
const ourDevices = new Set([
ourNumber,
ourPrimaryNumber,
...ourOtherDevices,
]);
const validSyncSender = ourDevices.has(envelope.source);
if (!validSyncSender) {
throw new Error(