]> Untitled Git - lemmy.git/blobdiff - lemmy_apub/src/lib.rs
In activity table, remove `user_id` and add `sensitive` (#127)
[lemmy.git] / lemmy_apub / src / lib.rs
index e7410ee253aa628a72c411923378c335cacda864..4894b036f6df5ea6a380fc3c409ec3483c63f1eb 100644 (file)
@@ -169,9 +169,6 @@ pub trait ActorType {
   fn public_key(&self) -> Option<String>;
   fn private_key(&self) -> Option<String>;
 
-  /// numeric id in the database, used for insert_activity
-  fn user_id(&self) -> i32;
-
   async fn send_follow(
     &self,
     follow_actor_id: &Url,
@@ -252,9 +249,9 @@ pub trait ActorType {
 /// persistent.
 pub async fn insert_activity<T>(
   ap_id: &Url,
-  user_id: i32,
   activity: T,
   local: bool,
+  sensitive: bool,
   pool: &DbPool,
 ) -> Result<(), LemmyError>
 where
@@ -262,7 +259,7 @@ where
 {
   let ap_id = ap_id.to_string();
   blocking(pool, move |conn| {
-    Activity::insert(conn, ap_id, user_id, &activity, local)
+    Activity::insert(conn, ap_id, &activity, local, sensitive)
   })
   .await??;
   Ok(())