when pulling public message, use the MultiDeviceProtocol to check

if this message is coming from us rather than checking the cached values
pull/1289/head
Audric Ackermann 5 years ago
parent ad24ad28d6
commit 5f47c42038
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -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:/);

Loading…
Cancel
Save