]> Untitled Git - lemmy.git/blobdiff - lemmy_apub/src/inbox/community_inbox.rs
Merge branch 'main' into move_views_to_diesel
[lemmy.git] / lemmy_apub / src / inbox / community_inbox.rs
index 37ae444e912658851011e20fb19e8cd1c110fa66..1c7b32e908e6c7aa2026afbf4d887b9816287e01 100644 (file)
@@ -30,6 +30,7 @@ use lemmy_db::{
   community::{Community, CommunityFollower, CommunityFollowerForm},
   user::User_,
   views::community_user_ban_view::CommunityUserBanView,
+  ApubObject,
   DbPool,
   Followable,
 };
@@ -118,7 +119,7 @@ pub(crate) async fn community_receive_message(
   // unconditionally.
   let actor_id = actor.actor_id_str();
   let user = blocking(&context.pool(), move |conn| {
-    User_::read_from_actor_id(&conn, &actor_id)
+    User_::read_from_apub_id(&conn, &actor_id)
   })
   .await??;
   check_community_or_site_ban(&user, &to_community, context.pool()).await?;
@@ -242,7 +243,7 @@ async fn handle_undo_follow(
   verify_activity_domains_valid(&follow, &user_url, false)?;
 
   let user = blocking(&context.pool(), move |conn| {
-    User_::read_from_actor_id(&conn, user_url.as_str())
+    User_::read_from_apub_id(&conn, user_url.as_str())
   })
   .await??;
   let community_follower_form = CommunityFollowerForm {
@@ -260,7 +261,7 @@ async fn handle_undo_follow(
   Ok(())
 }
 
-async fn check_community_or_site_ban(
+pub(crate) async fn check_community_or_site_ban(
   user: &User_,
   community: &Community,
   pool: &DbPool,