From 5f47c4203887152d7d8d6ee08d52ec31ac22c4e5 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 28 Jul 2020 12:20:54 +1000 Subject: [PATCH] when pulling public message, use the MultiDeviceProtocol to check if this message is coming from us rather than checking the cached values --- ts/receiver/receiver.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ts/receiver/receiver.ts b/ts/receiver/receiver.ts index 911b78516..c4c16762f 100644 --- a/ts/receiver/receiver.ts +++ b/ts/receiver/receiver.ts @@ -31,6 +31,7 @@ import { getEnvelopeId } from './common'; import { StringUtils } from '../session/utils'; import { SignalService } from '../protobuf'; import { BlockedNumberController } from '../util/blockedNumberController'; +import { MultiDeviceProtocol } from '../session/protocols'; // TODO: check if some of these exports no longer needed export { @@ -310,9 +311,7 @@ export async function handleUnencryptedMessage({ message: outerMessage }: any) { await updateProfile(conversation, profile, profileKey); } - const primaryDevice = window.storage.get('primaryDevicePubKey'); - const isOurDevice = - source && (source === ourNumber || source === primaryDevice); + const isOurDevice = await MultiDeviceProtocol.isOurDevice(source); const isPublicChatMessage = group && group.id && !!group.id.match(/^publicChat:/);