Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3516517
D13389.id44347.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
D13389.id44347.diff
View Options
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
@@ -5,6 +5,7 @@
import { clientAvatarValidator, type ClientAvatar } from './avatar-types.js';
import { type Media, mediaValidator } from './media-types.js';
import type { RawMessageInfo } from './message-types.js';
+import type { RelationshipOperation } from './messages/update-relationship.js';
import type { NotificationsCreationData } from './notif-types.js';
import type { OutboundP2PMessage } from './sqlite-types.js';
import {
@@ -43,6 +44,7 @@
CREATE_ENTRY: 'create_entry',
DELETE_ENTRY: 'delete_entry',
EDIT_ENTRY: 'edit_entry',
+ UPDATE_RELATIONSHIP: 'update_relationship',
});
export type DMOperationType = $Values<typeof dmOperationTypes>;
@@ -448,6 +450,29 @@
messageID: t.String,
});
+export type DMUpdateRelationshipOperation = {
+ +type: 'update_relationship',
+ +threadID: string,
+ +creatorID: string,
+ +time: number,
+ +operation: RelationshipOperation,
+ +messageID: string,
+};
+
+export const dmUpdateRelationshipOperationValidator: TInterface<DMUpdateRelationshipOperation> =
+ tShape<DMUpdateRelationshipOperation>({
+ type: tString(dmOperationTypes.UPDATE_RELATIONSHIP),
+ threadID: t.String,
+ creatorID: t.String,
+ time: t.Number,
+ operation: t.enums.of([
+ 'request_sent',
+ 'request_accepted',
+ 'farcaster_mutual',
+ ]),
+ messageID: t.String,
+ });
+
export type DMOperation =
| DMCreateThreadOperation
| DMCreateSidebarOperation
@@ -465,7 +490,8 @@
| DMChangeThreadReadStatusOperation
| DMCreateEntryOperation
| DMDeleteEntryOperation
- | DMEditEntryOperation;
+ | DMEditEntryOperation
+ | DMUpdateRelationshipOperation;
export const dmOperationValidator: TUnion<DMOperation> = t.union([
dmCreateThreadOperationValidator,
dmCreateSidebarOperationValidator,
@@ -484,6 +510,7 @@
dmCreateEntryOperationValidator,
dmDeleteEntryOperationValidator,
dmEditEntryOperationValidator,
+ dmUpdateRelationshipOperationValidator,
]);
export type DMOperationResult = {
diff --git a/lib/types/messages/update-relationship.js b/lib/types/messages/update-relationship.js
--- a/lib/types/messages/update-relationship.js
+++ b/lib/types/messages/update-relationship.js
@@ -18,6 +18,10 @@
export type FarcasterRelationshipOperation = 'farcaster_mutual';
+export type RelationshipOperation =
+ | TraditionalRelationshipOperation
+ | FarcasterRelationshipOperation;
+
export type UpdateTraditionalRelationshipMessageData = {
+type: 22,
+threadID: string,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 2:46 PM (19 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694938
Default Alt Text
D13389.id44347.diff (2 KB)
Attached To
Mode
D13389: [lib] Introduce DMRelationshipOperation
Attached
Detach File
Event Timeline
Log In to Comment