Rename: get_sender07() -> get_sender()
This commit is contained in:
@@ -475,7 +475,7 @@ impl FromId<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ impl FromId<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ impl FromId<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ impl FromId<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
@@ -802,7 +802,7 @@ impl FromId<DbConn> 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<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ impl FromId<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ impl User {
|
||||
}
|
||||
|
||||
fn fetch(url: &str) -> Result<CustomPerson> {
|
||||
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::<ApSignature>(text)?;
|
||||
@@ -517,7 +517,7 @@ impl User {
|
||||
&self,
|
||||
url: &str,
|
||||
) -> Result<(Vec<T>, Option<String>)> {
|
||||
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<T: Activity + serde::de::DeserializeOwned>(&self) -> Result<Vec<T>> {
|
||||
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<Vec<String>> {
|
||||
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<DbConn> 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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user