Adding cross-post quote and link. Fixes #189

This commit is contained in:
Dessalines 2021-03-25 13:28:47 -04:00
parent 1a1a522d9e
commit d8346d9e95
2 changed files with 10 additions and 2 deletions

@ -1 +1 @@
Subproject commit ebb1c594cd6ae91fa65c7f305c61f318eb10125f
Subproject commit 4a6036fce9515e43fcd1885f510330b13bb2e9bc

View 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;
}