getUntrustedConversations: Ensure we return conversationIds
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
3a0dc63196
commit
80ee429015
|
@ -1,14 +1,20 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isNotNil } from '../../util/isNotNil';
|
||||
|
||||
export function getUntrustedConversationIds(
|
||||
recipients: ReadonlyArray<string>
|
||||
): Array<string> {
|
||||
return recipients.filter(recipient => {
|
||||
const recipientConversation = window.ConversationController.getOrCreate(
|
||||
recipient,
|
||||
'private'
|
||||
);
|
||||
return recipientConversation.isUntrusted();
|
||||
});
|
||||
return recipients
|
||||
.map(recipient => {
|
||||
const recipientConversation = window.ConversationController.getOrCreate(
|
||||
recipient,
|
||||
'private'
|
||||
);
|
||||
return recipientConversation.isUntrusted()
|
||||
? recipientConversation.id
|
||||
: null;
|
||||
})
|
||||
.filter(isNotNil);
|
||||
}
|
||||
|
|
|
@ -1022,6 +1022,11 @@ export const getConversationsStoppingSend = createSelector(
|
|||
const conversations = conversationIds
|
||||
.map(conversationId => conversationSelector(conversationId))
|
||||
.filter(isNotNil);
|
||||
if (conversationIds.length !== conversations.length) {
|
||||
log.warn(
|
||||
`getConversationsStoppingSend: Started with ${conversationIds.length} items, ended up with ${conversations.length}.`
|
||||
);
|
||||
}
|
||||
return sortByTitle(conversations);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue