verify_person_in_community,
},
fetcher::user_or_community::UserOrCommunity,
- insert_activity,
+ insert_received_activity,
objects::{community::ApubCommunity, person::ApubPerson},
protocol::activities::following::{
accept::AcceptFollow,
person_id: actor.id,
pending: true,
};
- CommunityFollower::follow(context.pool(), &community_follower_form)
+ CommunityFollower::follow(&mut context.pool(), &community_follower_form)
.await
.ok();
#[tracing::instrument(skip_all)]
async fn verify(&self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
+ insert_received_activity(&self.id, context).await?;
verify_person(&self.actor, context).await?;
let object = self.object.dereference(context).await?;
if let UserOrCommunity::Community(c) = object {
#[tracing::instrument(skip_all)]
async fn receive(self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
- insert_activity(&self.id, &self, false, true, context).await?;
let actor = self.actor.dereference(context).await?;
let object = self.object.dereference(context).await?;
match object {
follower_id: actor.id,
pending: false,
};
- PersonFollower::follow(context.pool(), &form).await?;
+ PersonFollower::follow(&mut context.pool(), &form).await?;
}
UserOrCommunity::Community(c) => {
let form = CommunityFollowerForm {
person_id: actor.id,
pending: false,
};
- CommunityFollower::follow(context.pool(), &form).await?;
+ CommunityFollower::follow(&mut context.pool(), &form).await?;
}
}
context: &Data<LemmyContext>,
) -> Result<(), LemmyError> {
let local_user_view = local_user_view_from_jwt(&request.auth, context).await?;
- let community = Community::read(context.pool(), request.community_id).await?;
+ let community = Community::read(&mut context.pool(), request.community_id).await?;
UndoFollow::send(&local_user_view.person.into(), &community.into(), context).await
}
}