Improve experience for contacts without signal accounts
This commit is contained in:
parent
fe505a7f2f
commit
7fa730531a
11 changed files with 266 additions and 3 deletions
27
ts/util/isConversationSMSOnly.ts
Normal file
27
ts/util/isConversationSMSOnly.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isConversationUnregistered } from './isConversationUnregistered';
|
||||
|
||||
export type MinimalConversationType = Readonly<{
|
||||
type?: string;
|
||||
e164?: string;
|
||||
uuid?: string;
|
||||
discoveredUnregisteredAt?: number;
|
||||
}>;
|
||||
|
||||
export function isConversationSMSOnly(
|
||||
conversation: MinimalConversationType
|
||||
): boolean {
|
||||
const { e164, uuid, type } = conversation;
|
||||
// `direct` for redux, `private` for models and the database
|
||||
if (type !== 'direct' && type !== 'private') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e164 && !uuid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return isConversationUnregistered(conversation);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue