20 lines
567 B
TypeScript
20 lines
567 B
TypeScript
|
// Copyright 2022 Signal Messenger, LLC
|
||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
||
|
import type { UUIDStringType } from '../types/UUID';
|
||
|
import { strictAssert } from './assert';
|
||
|
|
||
|
export function startConversation(e164: string, uuid: UUIDStringType): void {
|
||
|
const conversation = window.ConversationController.lookupOrCreate({
|
||
|
e164,
|
||
|
uuid,
|
||
|
reason: 'util/startConversation',
|
||
|
});
|
||
|
strictAssert(
|
||
|
conversation,
|
||
|
`startConversation failed given ${e164}/${uuid} combination`
|
||
|
);
|
||
|
|
||
|
window.Whisper.events.trigger('showConversation', conversation.id);
|
||
|
}
|