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)]
#[serde(rename_all = "camelCase")]
pub struct ActorSource {
pub struct SourceProperty {
pub source: Source,
}
impl<U> UnparsedExtension<U> for ActorSource
impl<U> UnparsedExtension<U> for SourceProperty
where
U: UnparsedMutExt,
{
type Error = serde_json::Error;
fn try_from_unparsed(unparsed_mut: &mut U) -> Result<Self, Self::Error> {
Ok(ActorSource {
Ok(SourceProperty {
source: unparsed_mut.remove("source")?,
})
}
@ -370,7 +370,7 @@ where
}
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)]
#[activitystreams(Hashtag)]

View file

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