Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3299750
D13433.id44467.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
D13433.id44467.diff
View Options
diff --git a/lib/shared/dm-ops/update-relationship-spec.js b/lib/shared/dm-ops/update-relationship-spec.js
--- a/lib/shared/dm-ops/update-relationship-spec.js
+++ b/lib/shared/dm-ops/update-relationship-spec.js
@@ -12,14 +12,15 @@
dmOperation: DMUpdateRelationshipOperation,
utilities: ProcessDMOperationUtilities,
) {
- const { threadID, creatorID, time, operation, messageID } = dmOperation;
- const { viewerID, findUserIdentities } = utilities;
+ const { threadID, creatorID, time, operation, messageID, targetUserID } =
+ dmOperation;
+ const { findUserIdentities } = utilities;
if (operation !== 'farcaster_mutual') {
const messageData = {
type: messageTypes.UPDATE_RELATIONSHIP,
threadID,
creatorID,
- targetID: viewerID,
+ targetID: targetUserID,
time,
operation,
};
@@ -31,12 +32,12 @@
}
const { identities: userIdentities } = await findUserIdentities([
creatorID,
- viewerID,
+ targetUserID,
]);
const creatorFID = userIdentities[creatorID]?.farcasterID;
- const targetFID = userIdentities[viewerID]?.farcasterID;
+ const targetFID = userIdentities[targetUserID]?.farcasterID;
if (!creatorFID || !targetFID) {
- const errorMap = { creatorID: creatorFID, viewerID: targetFID };
+ const errorMap = { [creatorID]: creatorFID, [targetUserID]: targetFID };
throw new Error(
'could not fetch FID for either creator or target: ' +
JSON.stringify(errorMap),
@@ -47,7 +48,7 @@
threadID,
creatorID,
creatorFID,
- targetID: viewerID,
+ targetID: targetUserID,
targetFID,
time,
operation,
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
@@ -454,6 +454,7 @@
+creatorID: string,
+time: number,
+operation: RelationshipOperation,
+ +targetUserID: string,
+messageID: string,
};
export const dmUpdateRelationshipOperationValidator: TInterface<DMUpdateRelationshipOperation> =
@@ -467,6 +468,7 @@
'request_accepted',
'farcaster_mutual',
]),
+ targetUserID: tUserID,
messageID: t.String,
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 3:17 PM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535131
Default Alt Text
D13433.id44467.diff (2 KB)
Attached To
Mode
D13433: [lib] Include targetUserID in DMUpdateRelationshipOperation
Attached
Detach File
Event Timeline
Log In to Comment