]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/activity_queue.rs
Moving settings and secrets to context.
[lemmy.git] / crates / apub / src / activity_queue.rs
index 01959c7d72ba50f2faf4bf68efe54ebcf8de1427..f05c4fce434c0078e16f124c6dea162ae55ba780 100644 (file)
@@ -16,7 +16,7 @@ use background_jobs::{
   WorkerConfig,
 };
 use lemmy_db_schema::source::community::Community;
-use lemmy_utils::{location_info, settings::structs::Settings, LemmyError};
+use lemmy_utils::{location_info, LemmyError};
 use lemmy_websocket::LemmyContext;
 use log::{info, warn};
 use reqwest::Client;
@@ -56,7 +56,7 @@ pub(crate) async fn send_activity_new<T>(
 where
   T: Serialize,
 {
-  if !Settings::get().federation.enabled || inboxes.is_empty() {
+  if !context.settings().federation.enabled || inboxes.is_empty() {
     return Ok(());
   }
 
@@ -64,7 +64,7 @@ where
 
   // Don't send anything to ourselves
   // TODO: this should be a debug assert
-  let hostname = Settings::get().get_hostname_without_port()?;
+  let hostname = context.settings().get_hostname_without_port()?;
   let inboxes: Vec<&Url> = inboxes
     .iter()
     .filter(|i| i.domain().expect("valid inbox url") != hostname)