Add concat iterable utility

This commit is contained in:
Evan Hahn 2021-05-20 14:51:50 -05:00 committed by Scott Nonnenberg
parent 028b4f162b
commit 7c7f7ee5a0
3 changed files with 98 additions and 5 deletions

View file

@ -48,6 +48,7 @@ import {
LinkPreviewImage,
LinkPreviewMetadata,
} from '../linkPreviews/linkPreviewFetch';
import { concat } from '../util/iterables';
function stringToArrayBuffer(str: string): ArrayBuffer {
if (typeof str !== 'string') {
@ -1706,10 +1707,12 @@ export default class MessageSender {
isNotMe = r => r !== myE164;
}
const blockedIdentifiers = new Set([
...window.storage.getBlockedUuids(),
...window.storage.getBlockedNumbers(),
]);
const blockedIdentifiers = new Set(
concat(
window.storage.getBlockedUuids(),
window.storage.getBlockedNumbers()
)
);
const recipients = groupMembers.filter(
recipient => isNotMe(recipient) && !blockedIdentifiers.has(recipient)