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
|
// Copyright 2022 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import { isNotNil } from '../../util/isNotNil';
|
||||||
|
|
||||||
export function getUntrustedConversationIds(
|
export function getUntrustedConversationIds(
|
||||||
recipients: ReadonlyArray<string>
|
recipients: ReadonlyArray<string>
|
||||||
): Array<string> {
|
): Array<string> {
|
||||||
return recipients.filter(recipient => {
|
return recipients
|
||||||
|
.map(recipient => {
|
||||||
const recipientConversation = window.ConversationController.getOrCreate(
|
const recipientConversation = window.ConversationController.getOrCreate(
|
||||||
recipient,
|
recipient,
|
||||||
'private'
|
'private'
|
||||||
);
|
);
|
||||||
return recipientConversation.isUntrusted();
|
return recipientConversation.isUntrusted()
|
||||||
});
|
? recipientConversation.id
|
||||||
|
: null;
|
||||||
|
})
|
||||||
|
.filter(isNotNil);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1023,6 +1023,11 @@ export const getConversationsStoppingSend = createSelector(
|
||||||
const conversations = conversationIds
|
const conversations = conversationIds
|
||||||
.map(conversationId => conversationSelector(conversationId))
|
.map(conversationId => conversationSelector(conversationId))
|
||||||
.filter(isNotNil);
|
.filter(isNotNil);
|
||||||
|
if (conversationIds.length !== conversations.length) {
|
||||||
|
log.warn(
|
||||||
|
`getConversationsStoppingSend: Started with ${conversationIds.length} items, ended up with ${conversations.length}.`
|
||||||
|
);
|
||||||
|
}
|
||||||
return sortByTitle(conversations);
|
return sortByTitle(conversations);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue