Add community outbox #74
Loading…
Reference in New Issue
No description provided.
Delete Branch "community-outbox"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is trickier than I thought, so I'd like you to have a look before I end up rewriting everything.
@ -310,0 +317,4 @@
};
// TODO: this violates unique constraint (on update presumably)
//CommunityModerator::join(conn, &community_moderator_form)?;
This violates a DB constraint, and anyway it wont handle removed moderators.
2 options:
community.creator_id
).api/community.rs
, in theAddModToCommunity
, do an apub send, similar to this one inapi/comment.rs
:And create the activity.
@ -312,0 +329,4 @@
for o in outbox_items.many().unwrap() {
let page = PageExt::from_any_base(o)?.unwrap();
// TODO: this should not fetch the community, as it causes infinite recursion
let post = PostForm::from_apub(&page, client, pool, &community.actor_id()?).await?;
This causes infinite recursion, because
from_apub()
fetches the community (which means it also fetches the outbox again, and so on). I could pass the community in, but thats annoying because I'd have to change all implementations ofFromApub
.hrmm.... shouldn't the post::from_apub() only fetch the community if it doesn't exist yet / hits that refetch timer?
@ -77,2 +77,4 @@
post
.filter(community_id.eq(the_community_id))
.then_order_by(stickied.desc())
.limit(20)
This function was unused before so this should be fine (but I can rename it if you want).
WIP: Add community outboxto Add community outboxReady to review. Regarding mod updates, I just disabled that for now, so behaviour is the same as before (mods are only fetched the first time, but never updated). We should note that somewhere on the issue tracker, but not quite sure where.
Its worth emphasizing that this will not fetch any comments or votes, only posts. In the future we might add those to the outbox as well, but that will make parsing more difficult.
I spose we only really care about the stickies right? Maybe we should just filter by stickied, order by
published.desc()
. And rename thisstickied_for_community
Giteas giving me a really weird issue when I try to click on the files tab here:
template: repo/diff/box:152:65: executing "repo/diff/box" at <0>: nil pointer evaluating *models.Review.Type
I'll just leave comments below.
This is only really caring about the stickieds right? And I spose some recent posts. I'd also add an
.then_order_by(published.desc()
(the hot rank isn't available on the post table, just the view and fast_view).Nice, that's not too bad actually.
You can move the check after, this can be
Some of the stuff in fetcher.rs scares me cause we need to test the outbox fetching, and there isn't a test in here for that. But we can do that later.
Looks good tho, tests all passed.
Good suggestions, thanks!
Merged, I just hope I got the order of those filters right.