diff --git a/plume-common/src/activity_pub/inbox.rs b/plume-common/src/activity_pub/inbox.rs index daf3e949..2a6d53fb 100644 --- a/plume-common/src/activity_pub/inbox.rs +++ b/plume-common/src/activity_pub/inbox.rs @@ -364,7 +364,7 @@ pub trait FromId: Sized { id: &str, proxy: Option, ) -> Result, Self::Error)> { - request::get(id, Self::get_sender07(), proxy) + request::get(id, Self::get_sender(), proxy) .map_err(|_| (None, InboxError::DerefError)) .and_then(|mut r| { let json: serde_json::Value = r @@ -382,7 +382,7 @@ pub trait FromId: Sized { /// Tries to find a `Self` with a given ID (`id`), using `ctx` (a database) fn from_db(ctx: &C, id: &str) -> Result; - fn get_sender07() -> &'static dyn Signer; + fn get_sender() -> &'static dyn Signer; } /// Should be implemented by anything representing an ActivityPub actor. @@ -614,7 +614,7 @@ mod tests { Ok(Self) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { &*MY_SIGNER } } @@ -642,7 +642,7 @@ mod tests { Ok(Self) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { &*MY_SIGNER } } @@ -793,7 +793,7 @@ mod tests { Err(()) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { &*MY_SIGNER } } diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index 54ab27b7..a08ac0f5 100644 --- a/plume-models/src/blogs.rs +++ b/plume-models/src/blogs.rs @@ -475,7 +475,7 @@ impl FromId for Blog { Blog::insert(conn, new_blog) } - fn get_sender07() -> &'static dyn sign::Signer { + fn get_sender() -> &'static dyn sign::Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } } diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index aa3f61bd..f19f4691 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -349,7 +349,7 @@ impl FromId for Comment { Ok(comm) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } } diff --git a/plume-models/src/follows.rs b/plume-models/src/follows.rs index c8e7e691..bf1268c2 100644 --- a/plume-models/src/follows.rs +++ b/plume-models/src/follows.rs @@ -203,7 +203,7 @@ impl FromId for Follow { Follow::accept_follow07(conn, &actor, &target, follow, actor.id, target.id) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } } diff --git a/plume-models/src/likes.rs b/plume-models/src/likes.rs index fc0b016c..74d9ee83 100644 --- a/plume-models/src/likes.rs +++ b/plume-models/src/likes.rs @@ -149,7 +149,7 @@ impl FromId for Like { Ok(res) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } } diff --git a/plume-models/src/medias.rs b/plume-models/src/medias.rs index da59044b..0db6b2ab 100644 --- a/plume-models/src/medias.rs +++ b/plume-models/src/medias.rs @@ -221,7 +221,7 @@ impl Media { // TODO: conditional GET request::get( remote_url.as_str(), - User::get_sender07(), + User::get_sender(), CONFIG.proxy().cloned(), )? .copy_to(&mut dest)?; diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index d305578e..fd797cd9 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -802,7 +802,7 @@ impl FromId for Post { Ok(post) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to get local instance user") } } @@ -897,7 +897,7 @@ impl FromId for PostUpdate { Ok(post_update) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } } diff --git a/plume-models/src/reshares.rs b/plume-models/src/reshares.rs index d2c943bd..f169aa66 100644 --- a/plume-models/src/reshares.rs +++ b/plume-models/src/reshares.rs @@ -178,7 +178,7 @@ impl FromId for Reshare { Ok(res) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } } diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 4015f29a..d2e3ab1b 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -244,7 +244,7 @@ impl User { } fn fetch(url: &str) -> Result { - let mut res = get(url, Self::get_sender07(), CONFIG.proxy().cloned())?; + let mut res = get(url, Self::get_sender(), CONFIG.proxy().cloned())?; let text = &res.text()?; // without this workaround, publicKey is not correctly deserialized let ap_sign = serde_json::from_str::(text)?; @@ -517,7 +517,7 @@ impl User { &self, url: &str, ) -> Result<(Vec, Option)> { - let mut res = get(url, Self::get_sender07(), CONFIG.proxy().cloned())?; + let mut res = get(url, Self::get_sender(), CONFIG.proxy().cloned())?; let text = &res.text()?; let json: serde_json::Value = serde_json::from_str(text)?; let items = json["items"] @@ -534,7 +534,7 @@ impl User { pub fn fetch_outbox07(&self) -> Result> { let mut res = get( &self.outbox_url[..], - Self::get_sender07(), + Self::get_sender(), CONFIG.proxy().cloned(), )?; let text = &res.text()?; @@ -570,7 +570,7 @@ impl User { pub fn fetch_followers_ids(&self) -> Result> { let mut res = get( &self.followers_endpoint[..], - Self::get_sender07(), + Self::get_sender(), CONFIG.proxy().cloned(), )?; let text = &res.text()?; @@ -1044,7 +1044,7 @@ impl FromId for User { Ok(user) } - fn get_sender07() -> &'static dyn Signer { + fn get_sender() -> &'static dyn Signer { Instance::get_local_instance_user().expect("Failed to local instance user") } }