]> Untitled Git - lemmy.git/blobdiff - crates/api/src/community.rs
Refactor activitypub code
[lemmy.git] / crates / api / src / community.rs
index bb341294b2624965445c31aa0767d3c125faef4a..0bb64f373f2470e67b2a613c9f756e25d06a508e 100644 (file)
@@ -10,13 +10,14 @@ use actix_web::web::Data;
 use anyhow::Context;
 use lemmy_api_structs::{blocking, community::*};
 use lemmy_apub::{
-  activities::send::community::{send_add_mod, send_remove_mod},
   generate_apub_endpoint,
   generate_followers_url,
   generate_inbox_url,
   generate_shared_inbox_url,
   ActorType,
+  CommunityType,
   EndpointType,
+  UserType,
 };
 use lemmy_db_queries::{
   diesel_option_overwrite_to_url,
@@ -745,9 +746,11 @@ impl Perform for AddModToCommunity {
     })
     .await??;
     if data.added {
-      send_add_mod(user, updated_mod, community, context).await?;
+      community.send_add_mod(&user, updated_mod, context).await?;
     } else {
-      send_remove_mod(user, updated_mod, community, context).await?;
+      community
+        .send_remove_mod(&user, updated_mod, context)
+        .await?;
     }
 
     // Note: in case a remote mod is added, this returns the old moderators list, it will only get