Page MenuHomePhabricator

D13055.diff
No OneTemporary

D13055.diff

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
@@ -55,7 +55,9 @@
export type DMOperationSpecification = {
+op: DMOperation,
+supportsAutoRetry: boolean,
- +recipients: 'all_peer_devices' | 'self_devices',
+ +recipients:
+ | { +type: 'all_peer_devices' | 'self_devices' }
+ | { +type: 'some_users', +userIDs: $ReadOnlyArray<string> },
};
async function createMessagesToPeersFromDMOp(
@@ -71,10 +73,15 @@
}
let peerUserIDAndDeviceIDs = allPeerUserIDAndDeviceIDs;
- if (operation.recipients === 'self_devices') {
+ if (operation.recipients.type === 'self_devices') {
peerUserIDAndDeviceIDs = allPeerUserIDAndDeviceIDs.filter(
peer => peer.userID === currentUserInfo.id,
);
+ } else if (operation.recipients.type === 'some_users') {
+ const userIDs = new Set(operation.recipients.userIDs);
+ peerUserIDAndDeviceIDs = allPeerUserIDAndDeviceIDs.filter(peer =>
+ userIDs.has(peer.userID),
+ );
}
const thisDeviceID = await getContentSigningKey();

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 6:25 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2580655
Default Alt Text
D13055.diff (1 KB)

Event Timeline