Page MenuHomePhabricator

D13055.id43520.diff
No OneTemporary

D13055.id43520.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
Fri, Sep 20, 3:47 PM (21 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2149257
Default Alt Text
D13055.id43520.diff (1 KB)

Event Timeline