2022-02-16 10:36:21 -08:00
|
|
|
// Copyright 2022 Signal Messenger, LLC
|
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
2022-03-29 17:14:01 -07:00
|
|
|
import { isNotNil } from '../../util/isNotNil';
|
|
|
|
|
|
2022-02-16 10:36:21 -08:00
|
|
|
export function getUntrustedConversationIds(
|
|
|
|
|
recipients: ReadonlyArray<string>
|
|
|
|
|
): Array<string> {
|
2022-03-29 17:14:01 -07:00
|
|
|
return recipients
|
|
|
|
|
.map(recipient => {
|
|
|
|
|
const recipientConversation = window.ConversationController.getOrCreate(
|
|
|
|
|
recipient,
|
|
|
|
|
'private'
|
|
|
|
|
);
|
|
|
|
|
return recipientConversation.isUntrusted()
|
|
|
|
|
? recipientConversation.id
|
|
|
|
|
: null;
|
|
|
|
|
})
|
|
|
|
|
.filter(isNotNil);
|
2022-02-16 10:36:21 -08:00
|
|
|
}
|