boost only once to relavent timeline
This commit is contained in:
parent
7f50c1128b
commit
cf14b006a6
2 changed files with 10 additions and 6 deletions
|
@ -9,6 +9,6 @@
|
|||
title="转播">
|
||||
<input type="hidden" name="post_url" value="{{ post.object_uri }}">
|
||||
<i class="fa-solid fa-retweet"></i>
|
||||
{% if post.stats.boosts > 2 %}<span>{{ post.stats.boosts }}</span>{% endif %}
|
||||
{% if post.stats.boosts > 1 %}<span>{{ post.stats.boosts }}</span>{% endif %}
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -54,11 +54,15 @@ def post_reply(request: AuthedHttpRequest, post_id: int):
|
|||
@require_http_methods(["POST"])
|
||||
@login_required
|
||||
def post_boost(request: AuthedHttpRequest, post_id: int):
|
||||
Takahe.boost_post(post_id, request.user.identity.pk)
|
||||
post_url = request.POST.get("post_url")
|
||||
if post_url and request.user.mastodon_site:
|
||||
boost_toot_later(request.user, post_url)
|
||||
return render(request, "action_boost_post.html", {"post": Takahe.get_post(post_id)})
|
||||
# classic_repost = request.user.preference.mastodon_repost_mode == 1
|
||||
post = Takahe.get_post(post_id)
|
||||
if not post:
|
||||
raise BadRequest()
|
||||
if request.user.mastodon_site:
|
||||
boost_toot_later(request.user, post.object_uri)
|
||||
else:
|
||||
Takahe.boost_post(post_id, request.user.identity.pk)
|
||||
return render(request, "action_boost_post.html", {"post": post})
|
||||
|
||||
|
||||
@require_http_methods(["POST"])
|
||||
|
|
Loading…
Add table
Reference in a new issue