- if data.block {
- let block = move |conn: &'_ _| CommunityBlock::block(conn, &community_block_form);
- blocking(context.pool(), block)
- .await?
- .map_err(|e| LemmyError::from_error_message(e, "community_block_already_exists"))?;
-
- // Also, unfollow the community, and send a federated unfollow
- let community_follower_form = CommunityFollowerForm {
- community_id: data.community_id,
- person_id,
- pending: false,
- };
- blocking(context.pool(), move |conn: &'_ _| {
- CommunityFollower::unfollow(conn, &community_follower_form)
- })
- .await?