mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Fix/imprive Undo support
This commit is contained in:
parent
992cd55d7b
commit
572a84b4bd
3 changed files with 5 additions and 6 deletions
|
@ -288,6 +288,7 @@ async def _send_undo(db_session: AsyncSession, ap_object_id: str) -> None:
|
||||||
raise ValueError("Should never happen")
|
raise ValueError("Should never happen")
|
||||||
|
|
||||||
outbox_object_to_undo.undone_by_outbox_object_id = outbox_object.id
|
outbox_object_to_undo.undone_by_outbox_object_id = outbox_object.id
|
||||||
|
outbox_object_to_undo.is_deleted = True
|
||||||
|
|
||||||
if outbox_object_to_undo.ap_type == "Follow":
|
if outbox_object_to_undo.ap_type == "Follow":
|
||||||
if not outbox_object_to_undo.activity_object_ap_id:
|
if not outbox_object_to_undo.activity_object_ap_id:
|
||||||
|
|
|
@ -12,18 +12,16 @@
|
||||||
{% for outbox_object in outbox %}
|
{% for outbox_object in outbox %}
|
||||||
|
|
||||||
{% if outbox_object.ap_type == "Announce" %}
|
{% if outbox_object.ap_type == "Announce" %}
|
||||||
<div class="actor-action">You shared</div>
|
<div class="actor-action">You shared <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
|
||||||
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
|
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
|
||||||
{% elif outbox_object.ap_type == "Like" %}
|
{% elif outbox_object.ap_type == "Like" %}
|
||||||
<div class="actor-action">You liked</div>
|
<div class="actor-action">You liked <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
|
||||||
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
|
{{ utils.display_object(outbox_object.relates_to_anybox_object) }}
|
||||||
{% elif outbox_object.ap_type == "Follow" %}
|
{% elif outbox_object.ap_type == "Follow" %}
|
||||||
<div class="actor-action">You followed</div>
|
<div class="actor-action">You followed <span title="{{ outbox_object.ap_published_at.isoformat() }}">{{ outbox_object.ap_published_at | timeago }}</span></div>
|
||||||
{{ utils.display_actor(outbox_object.relates_to_actor, actors_metadata) }}
|
{{ utils.display_actor(outbox_object.relates_to_actor, actors_metadata) }}
|
||||||
{% elif outbox_object.ap_type in ["Article", "Note", "Video", "Question"] %}
|
{% elif outbox_object.ap_type in ["Article", "Note", "Video", "Question"] %}
|
||||||
{{ utils.display_object(outbox_object) }}
|
{{ utils.display_object(outbox_object) }}
|
||||||
{% else %}
|
|
||||||
Implement {{ outbox_object.ap_type }}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -571,7 +571,7 @@
|
||||||
{% if object.visibility in [visibility_enum.PUBLIC, visibility_enum.UNLISTED] %}
|
{% if object.visibility in [visibility_enum.PUBLIC, visibility_enum.UNLISTED] %}
|
||||||
<li>
|
<li>
|
||||||
{% if object.announced_via_outbox_object_ap_id %}
|
{% if object.announced_via_outbox_object_ap_id %}
|
||||||
{{ admin_undo_button(object.liked_via_outbox_object_ap_id, "unshare") }}
|
{{ admin_undo_button(object.announced_via_outbox_object_ap_id, "unshare") }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ admin_announce_button(object.ap_id, permalink_id=object.permalink_id) }}
|
{{ admin_announce_button(object.ap_id, permalink_id=object.permalink_id) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue