getUntrustedConversations: Ensure we return conversationIds
This commit is contained in:
parent
13f4948d4b
commit
42bd8cb4ce
2 changed files with 18 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1023,6 +1023,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 a new issue