From ddf171f1286efe2e3a8f553d034ff5e601373faa Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 13 Apr 2020 14:13:06 +0200 Subject: [PATCH] Use summary field for post title --- server/src/apub/post.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/apub/post.rs b/server/src/apub/post.rs index fa252c5eb..e45a7d210 100644 --- a/server/src/apub/post.rs +++ b/server/src/apub/post.rs @@ -41,7 +41,9 @@ impl Post { // Not needed when the Post is embedded in a collection (like for community outbox) .set_context_xsd_any_uri(context())? .set_id(base_url)? - .set_name_xsd_string(self.name.to_owned())? + // Use summary field to be consistent with mastodon content warning. + // https://mastodon.xyz/@Louisa/103987265222901387.json + .set_summary_xsd_string(self.name.to_owned())? .set_published(convert_datetime(self.published))? .set_to_xsd_any_uri(community.actor_id)? .set_attributed_to_xsd_any_uri(make_apub_endpoint(EndpointType::User, &creator.name))?; @@ -74,7 +76,7 @@ impl PostForm { let community = fetch_remote_community(&community_id, conn)?; Ok(PostForm { - name: oprops.get_name_xsd_string().unwrap().to_string(), + name: oprops.get_summary_xsd_string().unwrap().to_string(), url: oprops.get_url_xsd_any_uri().map(|u| u.to_string()), body: oprops.get_content_xsd_string().map(|c| c.to_string()), creator_id: creator.id,