|
|
|
@ -12,6 +12,7 @@ import { MultiDeviceProtocol, SessionProtocol } from '../session/protocols';
|
|
|
|
|
import { PubKey } from '../session/types';
|
|
|
|
|
|
|
|
|
|
import ByteBuffer from 'bytebuffer';
|
|
|
|
|
import { BlockedNumberController } from '../util';
|
|
|
|
|
|
|
|
|
|
async function unpairingRequestIsLegit(source: string, ourPubKey: string) {
|
|
|
|
|
const { textsecure, storage, lokiFileServerAPI } = window;
|
|
|
|
@ -287,6 +288,7 @@ export async function handleContacts(
|
|
|
|
|
await removeFromCache(envelope);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// tslint:disable-next-line: max-func-body-length
|
|
|
|
|
async function onContactReceived(details: any) {
|
|
|
|
|
const {
|
|
|
|
|
ConversationController,
|
|
|
|
@ -427,7 +429,15 @@ async function onContactReceived(details: any) {
|
|
|
|
|
verifiedEvent.viaContactSync = true;
|
|
|
|
|
await onVerified(verifiedEvent);
|
|
|
|
|
}
|
|
|
|
|
await conversation.trigger('change');
|
|
|
|
|
|
|
|
|
|
const isBlocked = details.blocked || false;
|
|
|
|
|
|
|
|
|
|
if (conversation.isPrivate()) {
|
|
|
|
|
await BlockedNumberController.setBlocked(conversation.id, isBlocked);
|
|
|
|
|
}
|
|
|
|
|
conversation.updateTextInputState();
|
|
|
|
|
|
|
|
|
|
await conversation.trigger('change', conversation);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
window.log.error('onContactReceived error:', Errors.toLogFormat(error));
|
|
|
|
|
}
|
|
|
|
|