Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3369004
D13326.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13326.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
@@ -11,6 +11,7 @@
DMAddMembersOperation,
DMAddViewerToThreadMembersOperation,
DMOperation,
+ ComposableDMOperation,
} from '../../types/dm-ops.js';
import type {
ThickRawThreadInfo,
@@ -68,19 +69,31 @@
INBOUND: 'InboundDMOperationSpecification',
});
+type OutboundDMOperationSpecificationRecipients =
+ | { +type: 'all_peer_devices' | 'self_devices' }
+ | { +type: 'some_users', +userIDs: $ReadOnlyArray<string> }
+ | { +type: 'all_thread_members', +threadID: string }
+ | { +type: 'some_devices', +deviceIDs: $ReadOnlyArray<string> };
+
// The operation generated on the sending client, causes changes to
// the state and broadcasting information to peers.
export type OutboundDMOperationSpecification = {
+type: 'OutboundDMOperationSpecification',
+op: DMOperation,
- +recipients:
- | { +type: 'all_peer_devices' | 'self_devices' }
- | { +type: 'some_users', +userIDs: $ReadOnlyArray<string> }
- | { +type: 'all_thread_members', +threadID: string }
- | { +type: 'some_devices', +deviceIDs: $ReadOnlyArray<string> },
+ +recipients: OutboundDMOperationSpecificationRecipients,
+sendOnly?: boolean,
};
+export type OutboundComposableDMOperationSpecification = {
+ +type: 'OutboundDMOperationSpecification',
+ +op: ComposableDMOperation,
+ +recipients: OutboundDMOperationSpecificationRecipients,
+ // Composable DM Ops are created only to be sent, locally we use
+ // dedicated mechanism for updating the store.
+ +sendOnly: true,
+ +composableMessageID: string,
+};
+
// The operation received from other peers, causes changes to
// the state and after processing, sends confirmation to the sender.
export type InboundDMOperationSpecification = {
diff --git a/lib/types/dm-ops.js b/lib/types/dm-ops.js
--- a/lib/types/dm-ops.js
+++ b/lib/types/dm-ops.js
@@ -368,6 +368,10 @@
unread: t.Boolean,
});
+export type ComposableDMOperation =
+ | DMSendTextMessageOperation
+ | DMSendMultimediaMessageOperation;
+
export type DMOperation =
| DMCreateThreadOperation
| DMCreateSidebarOperation
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 9:23 PM (20 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2586362
Default Alt Text
D13326.diff (2 KB)
Attached To
Mode
D13326: [lib] introduce type for composable DMOperation
Attached
Detach File
Event Timeline
Log In to Comment