request_counter: &mut i32,
) -> Result<(), LemmyError> {
let create = Create::from_any_base(activity)?.context(location_info!())?;
- verify_activity_domains_valid(&create, &expected_domain, true)?;
+ verify_activity_domains_valid(&create, expected_domain, true)?;
verify_is_addressed_to_public(&create)?;
let kind = create
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let update = Update::from_any_base(activity.to_owned())?.context(location_info!())?;
- verify_activity_domains_valid(&update, &expected_domain, false)?;
+ verify_activity_domains_valid(&update, expected_domain, false)?;
verify_is_addressed_to_public(&update)?;
verify_modification_actor_instance(&update, &announce, context, request_counter).await?;
request_counter: &mut i32,
) -> Result<(), LemmyError> {
let like = Like::from_any_base(activity)?.context(location_info!())?;
- verify_activity_domains_valid(&like, &expected_domain, false)?;
+ verify_activity_domains_valid(&like, expected_domain, false)?;
verify_is_addressed_to_public(&like)?;
let object_id = like
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- match fetch_post_or_comment_by_id(&object_id, context, request_counter).await? {
+ match fetch_post_or_comment_by_id(object_id, context, request_counter).await? {
PostOrComment::Post(post) => receive_like_post(like, *post, context, request_counter).await,
PostOrComment::Comment(comment) => {
receive_like_comment(like, *comment, context, request_counter).await
}
let dislike = Dislike::from_any_base(activity)?.context(location_info!())?;
- verify_activity_domains_valid(&dislike, &expected_domain, false)?;
+ verify_activity_domains_valid(&dislike, expected_domain, false)?;
verify_is_addressed_to_public(&dislike)?;
let object_id = dislike
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- match fetch_post_or_comment_by_id(&object_id, context, request_counter).await? {
+ match fetch_post_or_comment_by_id(object_id, context, request_counter).await? {
PostOrComment::Post(post) => {
receive_dislike_post(dislike, *post, context, request_counter).await
}
match find_object_by_id(context, object).await {
Ok(Object::Post(p)) => {
- verify_activity_domains_valid(&delete, &expected_domain, true)?;
+ verify_activity_domains_valid(&delete, expected_domain, true)?;
receive_delete_post(context, *p).await
}
Ok(Object::Comment(c)) => {
- verify_activity_domains_valid(&delete, &expected_domain, true)?;
+ verify_activity_domains_valid(&delete, expected_domain, true)?;
receive_delete_comment(context, *c).await
}
Ok(Object::Community(c)) => {
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- let remove_mod = get_or_fetch_and_upsert_person(&remove_mod, context, request_counter).await?;
+ let remove_mod = get_or_fetch_and_upsert_person(remove_mod, context, request_counter).await?;
let form = CommunityModeratorForm {
community_id: community.id,
person_id: remove_mod.id,
.context(location_info!())?;
match find_object_by_id(context, object).await {
Ok(Object::Post(p)) => {
- verify_activity_domains_valid(&delete, &expected_domain, true)?;
+ verify_activity_domains_valid(&delete, expected_domain, true)?;
receive_undo_delete_post(context, *p).await
}
Ok(Object::Comment(c)) => {
- verify_activity_domains_valid(&delete, &expected_domain, true)?;
+ verify_activity_domains_valid(&delete, expected_domain, true)?;
receive_undo_delete_comment(context, *c).await
}
Ok(Object::Community(c)) => {
) -> Result<(), LemmyError> {
let remove = Remove::from_any_base(undo.object().to_owned().one().context(location_info!())?)?
.context(location_info!())?;
- verify_activity_domains_valid(&remove, &expected_domain, false)?;
+ verify_activity_domains_valid(&remove, expected_domain, false)?;
verify_is_addressed_to_public(&remove)?;
verify_undo_remove_actor_instance(&undo, &remove, &announce, context).await?;
) -> Result<(), LemmyError> {
let like = Like::from_any_base(undo.object().to_owned().one().context(location_info!())?)?
.context(location_info!())?;
- verify_activity_domains_valid(&like, &expected_domain, false)?;
+ verify_activity_domains_valid(&like, expected_domain, false)?;
verify_is_addressed_to_public(&like)?;
let object_id = like
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- match fetch_post_or_comment_by_id(&object_id, context, request_counter).await? {
+ match fetch_post_or_comment_by_id(object_id, context, request_counter).await? {
PostOrComment::Post(post) => {
receive_undo_like_post(&like, *post, context, request_counter).await
}
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- let new_mod = get_or_fetch_and_upsert_person(&new_mod, context, request_counter).await?;
+ let new_mod = get_or_fetch_and_upsert_person(new_mod, context, request_counter).await?;
// If we had to refetch the community while parsing the activity, then the new mod has already
// been added. Skip it here as it would result in a duplicate key error.
) -> Result<(), LemmyError> {
let dislike = Dislike::from_any_base(undo.object().to_owned().one().context(location_info!())?)?
.context(location_info!())?;
- verify_activity_domains_valid(&dislike, &expected_domain, false)?;
+ verify_activity_domains_valid(&dislike, expected_domain, false)?;
verify_is_addressed_to_public(&dislike)?;
let object_id = dislike
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- match fetch_post_or_comment_by_id(&object_id, context, request_counter).await? {
+ match fetch_post_or_comment_by_id(object_id, context, request_counter).await? {
PostOrComment::Post(post) => {
receive_undo_dislike_post(&dislike, *post, context, request_counter).await
}
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- let blocked_user =
- get_or_fetch_and_upsert_person(&blocked_user, context, request_counter).await?;
+ let blocked_user = get_or_fetch_and_upsert_person(blocked_user, context, request_counter).await?;
let community_user_ban_form = CommunityPersonBanForm {
community_id: community.id,
let block = Block::from_any_base(object)?.context(location_info!())?;
let community = extract_community_from_cc(&block, context).await?;
- verify_activity_domains_valid(&block, &expected_domain, false)?;
+ verify_activity_domains_valid(&block, expected_domain, false)?;
verify_is_addressed_to_public(&block)?;
verify_undo_remove_actor_instance(&undo, &block, &announce, context).await?;
.object()
.as_single_xsd_any_uri()
.context(location_info!())?;
- let blocked_user =
- get_or_fetch_and_upsert_person(&blocked_user, context, request_counter).await?;
+ let blocked_user = get_or_fetch_and_upsert_person(blocked_user, context, request_counter).await?;
let community_user_ban_form = CommunityPersonBanForm {
community_id: community.id,
.flatten()
.context(location_info!())?;
let community_id: DbUrl = community_id.to_owned().into();
- let community = blocking(&context.pool(), move |conn| {
- Community::read_from_apub_id(&conn, &community_id)
+ let community = blocking(context.pool(), move |conn| {
+ Community::read_from_apub_id(conn, &community_id)
})
.await??;
Ok(community)
.as_single_xsd_any_uri()
.context(location_info!())?
.to_owned();
- let actor = blocking(&context.pool(), move |conn| {
- Person::read_from_apub_id(&conn, &actor.into())
+ let actor = blocking(context.pool(), move |conn| {
+ Person::read_from_apub_id(conn, &actor.into())
})
.await??;