diff --git a/lib/shared/dm-ops/dm-op-utils.js b/lib/shared/dm-ops/dm-op-utils.js --- a/lib/shared/dm-ops/dm-op-utils.js +++ b/lib/shared/dm-ops/dm-op-utils.js @@ -76,7 +76,8 @@ +recipients: | { +type: 'all_peer_devices' | 'self_devices' } | { +type: 'some_users', +userIDs: $ReadOnlyArray } - | { +type: 'all_thread_members', +threadID: string }, + | { +type: 'all_thread_members', +threadID: string } + | { +type: 'some_devices', +deviceIDs: $ReadOnlyArray }, +sendOnly?: boolean, }; @@ -123,6 +124,11 @@ peerUserIDAndDeviceIDs = allPeerUserIDAndDeviceIDs.filter(peer => userIDs.has(peer.userID), ); + } else if (operation.recipients.type === 'some_devices') { + const deviceIDs = new Set(operation.recipients.deviceIDs); + peerUserIDAndDeviceIDs = allPeerUserIDAndDeviceIDs.filter(peer => + deviceIDs.has(peer.deviceID), + ); } const thisDeviceID = await getContentSigningKey();