From 70949fad024d8c4df2f045cf5dab72a40ae811ff Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 7 Mar 2022 00:03:01 +0900 Subject: [PATCH] Rename: ActorSource -> SourceProperty --- plume-common/src/activity_pub/mod.rs | 8 ++++---- plume-models/src/blogs.rs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index cbed4870..40cbe05b 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -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 UnparsedExtension for ActorSource +impl UnparsedExtension for SourceProperty where U: UnparsedMutExt, { type Error = serde_json::Error; fn try_from_unparsed(unparsed_mut: &mut U) -> Result { - Ok(ActorSource { + Ok(SourceProperty { source: unparsed_mut.remove("source")?, }) } @@ -370,7 +370,7 @@ where } pub type CustomPerson = Ext1, ApSignature07>; -pub type CustomGroup = Ext2, ApSignature07, ActorSource>; +pub type CustomGroup = Ext2, ApSignature07, SourceProperty>; #[derive(Clone, Debug, Default, UnitString)] #[activitystreams(Hashtag)] diff --git a/plume-models/src/blogs.rs b/plume-models/src/blogs.rs index 76853a50..4428c6cc 100644 --- a/plume-models/src/blogs.rs +++ b/plume-models/src/blogs.rs @@ -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"),