Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32236317
D13055.1765222117.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13055.1765222117.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 8, 7:28 PM (9 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5850140
Default Alt Text
D13055.1765222117.diff (1 KB)
Attached To
Mode
D13055: [lib] Allow sending messages to some users
Attached
Detach File
Event Timeline
Log In to Comment