mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Merge pull request 'Use name
field for post titles instead of summary
(ref #1220)' (#173) from apub-post-name into main
Reviewed-on: https://yerbamate.ml/LemmyNet/lemmy/pulls/173
This commit is contained in:
commit
2cbd158a11
@ -58,8 +58,9 @@ impl ToApub for Post {
|
|||||||
// https://git.asonix.dog/Aardwolf/activitystreams/issues/5
|
// https://git.asonix.dog/Aardwolf/activitystreams/issues/5
|
||||||
.set_many_contexts(lemmy_context()?)
|
.set_many_contexts(lemmy_context()?)
|
||||||
.set_id(self.ap_id.to_owned().into_inner())
|
.set_id(self.ap_id.to_owned().into_inner())
|
||||||
// Use summary field to be consistent with mastodon content warning.
|
.set_name(self.name.to_owned())
|
||||||
// https://mastodon.xyz/@Louisa/103987265222901387.json
|
// `summary` field for compatibility with lemmy v0.9.9 and older,
|
||||||
|
// TODO: remove this after some time
|
||||||
.set_summary(self.name.to_owned())
|
.set_summary(self.name.to_owned())
|
||||||
.set_published(convert_datetime(self.published))
|
.set_published(convert_datetime(self.published))
|
||||||
.set_many_tos(vec![community.actor_id.into_inner(), public()])
|
.set_many_tos(vec![community.actor_id.into_inner(), public()])
|
||||||
@ -174,8 +175,11 @@ impl FromApubToForm<PageExt> for PostForm {
|
|||||||
|
|
||||||
let name = page
|
let name = page
|
||||||
.inner
|
.inner
|
||||||
.summary()
|
.name()
|
||||||
.as_ref()
|
.map(|s| s.map(|s2| s2.to_owned()))
|
||||||
|
// The following is for compatibility with lemmy v0.9.9 and older
|
||||||
|
// TODO: remove it after some time (along with the map above)
|
||||||
|
.or_else(|| page.inner.summary().map(|s| s.to_owned()))
|
||||||
.context(location_info!())?
|
.context(location_info!())?
|
||||||
.as_single_xsd_string()
|
.as_single_xsd_string()
|
||||||
.context(location_info!())?
|
.context(location_info!())?
|
||||||
|
Loading…
Reference in New Issue
Block a user