Adding post and comment ap_id columns. #31

Closed
dessalines wants to merge 0 commits from federation_add_fed_columns into federation
Owner
No description provided.
dessalines reviewed 2020-04-04 00:09:30 +00:00
@ -36,0 +34,4 @@
EndpointType::Community => "community",
EndpointType::User => "user",
EndpointType::Post => "post",
EndpointType::Comment => "comment",
Author
Owner

@nutomic I changed these to their full names, they're urls so no reason to not be explicit, and /c/ could be either a community or a comment.

@nutomic I changed these to their full names, they're urls so no reason to not be explicit, and /c/ could be either a community or a comment.
Owner

Not gonna work, you would have to change them in routes/federation.rs as well. Anyway I think we will have to change the URLs so that they are the same for html and activity+json content types, so that you can simply copy the URL into the Masto search and have it fetch the object.

Not gonna work, you would have to change them in routes/federation.rs as well. Anyway I think we will have to change the URLs so that they are the same for html and activity+json content types, so that you can simply copy the URL into the Masto search and have it fetch the object.
Owner

Gonna revert this for now, anyway we are not federating comments yet.

Gonna revert this for now, anyway we are not federating comments yet.
dessalines reviewed 2020-04-04 02:12:37 +00:00
@ -71,0 +103,4 @@
))
.get_result::<Self>(conn)
}
}
Author
Owner

Added some helper DB methods.

Added some helper DB methods.
Owner

Could you explain how you imagine this to work with federation?

Could you explain how you imagine this to work with federation?
Author
Owner

Activitypub calls deletes "tombstones" I think, and it'll have to post that to all its recipients.

Activitypub calls deletes "tombstones" I think, and it'll have to post that to all its recipients.
Owner

Ah okay, thats still far away. And the update_ap_id() method is for db migrations or on comment creation then, I see.

Ah okay, thats still far away. And the update_ap_id() method is for db migrations or on comment creation then, I see.
dessalines reviewed 2020-04-04 02:13:08 +00:00
@ -61,0 +72,4 @@
diesel::update(post.find(post_id))
.set(ap_id.eq(apid))
.get_result::<Self>(conn)
}
Author
Owner

Necessary since the post ap_id comes from the row id.

Necessary since the post ap_id comes from the row id.
Owner

Necessary in what case?

Necessary in what case?
Author
Owner

You mean why a post needs an activitypub id? Our instance might have local posts, or federated ones. The local ones can use this helper method, the federated ones that we receive will have their external ones here.

You mean why a post needs an activitypub id? Our instance might have local posts, or federated ones. The local ones can use this helper method, the federated ones that we receive will have their external ones here.
nutomic closed this pull request 2020-04-07 15:32:25 +00:00
nutomic reopened this pull request 2020-04-07 15:32:56 +00:00
Owner

Okay merged.

Okay merged.
nutomic closed this pull request 2020-04-07 15:36:29 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: LemmyNet/lemmy#31
No description provided.