2021-06-02 17:24:22 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
export const isInSystemContacts = ({
|
|
|
|
type,
|
|
|
|
name,
|
2023-03-22 19:25:52 +00:00
|
|
|
systemGivenName,
|
|
|
|
systemFamilyName,
|
2021-06-02 17:24:22 +00:00
|
|
|
}: Readonly<{
|
|
|
|
type?: string;
|
|
|
|
name?: string;
|
2023-03-22 19:25:52 +00:00
|
|
|
systemGivenName?: string;
|
|
|
|
systemFamilyName?: string;
|
2021-06-02 17:24:22 +00:00
|
|
|
}>): boolean =>
|
|
|
|
// `direct` for redux, `private` for models and the database
|
2023-03-22 19:25:52 +00:00
|
|
|
(type === 'direct' || type === 'private') &&
|
|
|
|
(typeof name === 'string' ||
|
|
|
|
typeof systemGivenName === 'string' ||
|
|
|
|
typeof systemFamilyName === 'string');
|