Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3318317
D13389.id44365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13389.id44365.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>;
@@ -385,7 +387,6 @@
+text: string,
+messageID: string,
};
-
export const dmCreateEntryOperationValidator: TInterface<DMCreateEntryOperation> =
tShape<DMCreateEntryOperation>({
type: tString(dmOperationTypes.CREATE_ENTRY),
@@ -409,7 +410,6 @@
+prevText: string,
+messageID: string,
};
-
export const dmDeleteEntryOperationValidator: TInterface<DMDeleteEntryOperation> =
tShape<DMDeleteEntryOperation>({
type: tString(dmOperationTypes.DELETE_ENTRY),
@@ -434,7 +434,6 @@
+text: string,
+messageID: string,
};
-
export const dmEditEntryOperationValidator: TInterface<DMEditEntryOperation> =
tShape<DMEditEntryOperation>({
type: tString(dmOperationTypes.EDIT_ENTRY),
@@ -448,6 +447,28 @@
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 +486,8 @@
| DMChangeThreadReadStatusOperation
| DMCreateEntryOperation
| DMDeleteEntryOperation
- | DMEditEntryOperation;
+ | DMEditEntryOperation
+ | DMUpdateRelationshipOperation;
export const dmOperationValidator: TUnion<DMOperation> = t.union([
dmCreateThreadOperationValidator,
dmCreateSidebarOperationValidator,
@@ -484,6 +506,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
Wed, Nov 20, 8:25 PM (21 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2548685
Default Alt Text
D13389.id44365.diff (3 KB)
Attached To
Mode
D13389: [lib] Introduce DMRelationshipOperation
Attached
Detach File
Event Timeline
Log In to Comment