Rename: ActorSource -> SourceProperty

This commit is contained in:
Kitaiti Makoto 2022-03-07 00:03:01 +09:00
parent 1f5ce8e504
commit 70949fad02
2 changed files with 7 additions and 7 deletions

View File

@ -347,18 +347,18 @@ where
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ActorSource { pub struct SourceProperty {
pub source: Source, pub source: Source,
} }
impl<U> UnparsedExtension<U> for ActorSource impl<U> UnparsedExtension<U> for SourceProperty
where where
U: UnparsedMutExt, U: UnparsedMutExt,
{ {
type Error = serde_json::Error; type Error = serde_json::Error;
fn try_from_unparsed(unparsed_mut: &mut U) -> Result<Self, Self::Error> { fn try_from_unparsed(unparsed_mut: &mut U) -> Result<Self, Self::Error> {
Ok(ActorSource { Ok(SourceProperty {
source: unparsed_mut.remove("source")?, source: unparsed_mut.remove("source")?,
}) })
} }
@ -370,7 +370,7 @@ where
} }
pub type CustomPerson = Ext1<ApActor<Person>, ApSignature07>; pub type CustomPerson = Ext1<ApActor<Person>, ApSignature07>;
pub type CustomGroup = Ext2<ApActor<Group>, ApSignature07, ActorSource>; pub type CustomGroup = Ext2<ApActor<Group>, ApSignature07, SourceProperty>;
#[derive(Clone, Debug, Default, UnitString)] #[derive(Clone, Debug, Default, UnitString)]
#[activitystreams(Hashtag)] #[activitystreams(Hashtag)]

View File

@ -28,8 +28,8 @@ use openssl::{
}; };
use plume_common::activity_pub::{ use plume_common::activity_pub::{
inbox::{AsActor, FromId, FromId07}, inbox::{AsActor, FromId, FromId07},
sign, ActivityStream, ActorSource, ApSignature, ApSignature07, CustomGroup as CustomGroup07, sign, ActivityStream, ApSignature, ApSignature07, CustomGroup as CustomGroup07, Id, IntoId,
Id, IntoId, PublicKey, PublicKey07, Source, ToAsString, ToAsUri, PublicKey, PublicKey07, Source, SourceProperty, ToAsString, ToAsUri,
}; };
use url::Url; use url::Url;
use webfinger::*; use webfinger::*;
@ -239,7 +239,7 @@ impl Blog {
blog.set_name(self.title.clone()); blog.set_name(self.title.clone());
blog.set_outbox(self.outbox_url.parse()?); blog.set_outbox(self.outbox_url.parse()?);
blog.set_summary(self.summary_html.to_string()); blog.set_summary(self.summary_html.to_string());
let source = ActorSource { let source = SourceProperty {
source: Source { source: Source {
content: self.summary.clone(), content: self.summary.clone(),
media_type: String::from("text/markdown"), media_type: String::from("text/markdown"),