]> Untitled Git - lemmy-ui.git/commitdiff
Adding cross-post quote and link. Fixes #189
authorDessalines <tyhou13@gmx.com>
Thu, 25 Mar 2021 17:28:47 +0000 (13:28 -0400)
committerDessalines <tyhou13@gmx.com>
Thu, 25 Mar 2021 17:28:47 +0000 (13:28 -0400)
lemmy-translations
src/shared/components/post-listing.tsx

index ebb1c594cd6ae91fa65c7f305c61f318eb10125f..4a6036fce9515e43fcd1885f510330b13bb2e9bc 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ebb1c594cd6ae91fa65c7f305c61f318eb10125f
+Subproject commit 4a6036fce9515e43fcd1885f510330b13bb2e9bc
index c10a8dda851fac93fd2bf2ad72f50590bbf36fd5..32a176aafeaac4e0ae85860548805fda37b59f9f 100644 (file)
@@ -1284,11 +1284,19 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
       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;
   }