From d8346d9e95a67595a2888bfc90b81297a1b4048a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 25 Mar 2021 13:28:47 -0400 Subject: [PATCH] Adding cross-post quote and link. Fixes #189 --- lemmy-translations | 2 +- src/shared/components/post-listing.tsx | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lemmy-translations b/lemmy-translations index ebb1c59..4a6036f 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit ebb1c594cd6ae91fa65c7f305c61f318eb10125f +Subproject commit 4a6036fce9515e43fcd1885f510330b13bb2e9bc diff --git a/src/shared/components/post-listing.tsx b/src/shared/components/post-listing.tsx index c10a8dd..32a176a 100644 --- a/src/shared/components/post-listing.tsx +++ b/src/shared/components/post-listing.tsx @@ -1284,11 +1284,19 @@ export class PostListing extends Component { params += `&url=${encodeURIComponent(post.url)}`; } if (post.body) { - params += `&body=${encodeURIComponent(post.body)}`; + params += `&body=${encodeURIComponent(this.crossPostBody())}`; } return params; } + crossPostBody(): string { + let post = this.props.post_view.post; + let body = `${i18n.t("cross_posted_from")} ${ + post.ap_id + }\n\n---\n\n${post.body.replace(/^/gm, "> ")}`; + return body; + } + get showBody(): boolean { return this.props.showBody || this.state.showBody; } -- 2.44.1