mirror of
https://github.com/versia-pub/activitypub.git
synced 2026-03-13 02:49:17 +01:00
fix: change some thing to point to API_DOMAIN
This commit is contained in:
parent
0b4574b2d1
commit
20eede0c08
3 changed files with 57 additions and 57 deletions
|
|
@ -87,24 +87,24 @@ pub async fn versia_user_from_db(
|
|||
let url = Url::parse(&user.url)?;
|
||||
let ap = user.ap_json.unwrap();
|
||||
let serialized_ap: crate::objects::person::Person = serde_json::from_str(&ap)?;
|
||||
let inbox_url = Url::parse("https://ap.versia.social/apbridge/versia/inbox")?;
|
||||
let inbox_url = Url::parse(&("https://".to_string() + &API_DOMAIN + "/apbridge/versia/inbox"))?;
|
||||
let outbox_url = Url::parse(
|
||||
("https://ap.versia.social/apbridge/versia/outbox/".to_string() + &user.id).as_str(),
|
||||
("https://".to_string() + &API_DOMAIN + "/apbridge/versia/outbox/" + &user.id).as_str(),
|
||||
)?;
|
||||
let followers_url = Url::parse(
|
||||
("https://ap.versia.social/apbridge/versia/followers/".to_string() + &user.id).as_str(),
|
||||
("https://".to_string() + &API_DOMAIN + "/apbridge/versia/followers/" + &user.id).as_str(),
|
||||
)?;
|
||||
let following_url = Url::parse(
|
||||
("https://ap.versia.social/apbridge/versia/following/".to_string() + &user.id).as_str(),
|
||||
("https://".to_string() + &API_DOMAIN + "/apbridge/versia/following/" + &user.id).as_str(),
|
||||
)?;
|
||||
let featured_url = Url::parse(
|
||||
("https://ap.versia.social/apbridge/versia/featured/".to_string() + &user.id).as_str(),
|
||||
("https://".to_string() + &API_DOMAIN + "/apbridge/versia/featured/" + &user.id).as_str(),
|
||||
)?;
|
||||
let likes_url = Url::parse(
|
||||
("https://ap.versia.social/apbridge/versia/likes/".to_string() + &user.id).as_str(),
|
||||
("https://".to_string() + &API_DOMAIN + "/apbridge/versia/likes/" + &user.id).as_str(),
|
||||
)?;
|
||||
let dislikes_url = Url::parse(
|
||||
("https://ap.versia.social/apbridge/versia/dislikes/".to_string() + &user.id).as_str(),
|
||||
("https://".to_string() + &API_DOMAIN + "/apbridge/versia/dislikes/" + &user.id).as_str(),
|
||||
)?;
|
||||
let og_displayname_ref = user.name.clone();
|
||||
let og_username_ref = user.username.clone();
|
||||
|
|
@ -256,7 +256,7 @@ pub async fn db_post_from_url(url: Url) -> anyhow::Result<entities::post::Model>
|
|||
Ok(post)
|
||||
} else {
|
||||
let post = fetch_note_from_url(url.clone()).await?;
|
||||
let res = receive_versia_note(post, "https://ap.versia.social/example".to_string()).await?; // TODO: Replace user id with actual user id
|
||||
let res = receive_versia_note(post, "https://".to_string() + &API_DOMAIN + "/example").await?; // TODO: Replace user id with actual user id
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,25 +72,25 @@ pub enum VisibilityType {
|
|||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
pub enum VersiaExtensions {
|
||||
#[serde(rename = "org.versia:microblogging/Announce")]
|
||||
#[serde(rename = "pub.versia:microblogging/Announce")]
|
||||
Announce,
|
||||
#[serde(rename = "org.versia:custom_emojis")]
|
||||
#[serde(rename = "pub.versia:custom_emojis")]
|
||||
CustomEmojis,
|
||||
#[serde(rename = "org.versia:reactions/Reaction")]
|
||||
#[serde(rename = "pub.versia:reactions/Reaction")]
|
||||
Reaction,
|
||||
#[serde(rename = "org.versia:reactions")]
|
||||
#[serde(rename = "pub.versia:reactions")]
|
||||
Reactions,
|
||||
#[serde(rename = "org.versia:polls")]
|
||||
#[serde(rename = "pub.versia:polls")]
|
||||
Polls,
|
||||
#[serde(rename = "org.versia:is_cat")]
|
||||
#[serde(rename = "pub.versia:is_cat")]
|
||||
IsCat,
|
||||
#[serde(rename = "org.versia:server_endorsement/Endorsement")]
|
||||
#[serde(rename = "pub.versia:server_endorsement/Endorsement")]
|
||||
Endorsement,
|
||||
#[serde(rename = "org.versia:server_endorsement")]
|
||||
#[serde(rename = "pub.versia:server_endorsement")]
|
||||
EndorsementCollection,
|
||||
#[serde(rename = "org.versia:reports/Report")]
|
||||
#[serde(rename = "pub.versia:reports/Report")]
|
||||
Report,
|
||||
#[serde(rename = "org.versia:vanity")]
|
||||
#[serde(rename = "pub.versia:vanity")]
|
||||
Vanity,
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ pub struct User {
|
|||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
pub struct ExtensionSpecs {
|
||||
#[serde(rename = "org.versia:custom_emojis")]
|
||||
#[serde(rename = "pub.versia:custom_emojis")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub custom_emojis: Option<CustomEmojis>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue