Page MenuHomePhabricator

D13326.id44207.diff
No OneTemporary

D13326.id44207.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
@@ -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

Mime Type
text/plain
Expires
Sun, Oct 20, 1:35 AM (19 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2328265
Default Alt Text
D13326.id44207.diff (2 KB)

Event Timeline