mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-21 22:27:11 +00:00
Adding cross-post quote and link. Fixes #189
This commit is contained in:
parent
1a1a522d9e
commit
d8346d9e95
|
@ -1 +1 @@
|
|||
Subproject commit ebb1c594cd6ae91fa65c7f305c61f318eb10125f
|
||||
Subproject commit 4a6036fce9515e43fcd1885f510330b13bb2e9bc
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue