diff --git a/activitypub.py b/activitypub.py index b891674..b5ed7c9 100644 --- a/activitypub.py +++ b/activitypub.py @@ -180,6 +180,7 @@ class MicroblogPubBackend(Backend): {"box": Box.OUTBOX.value, "activity.object.id": obj.id}, {"$inc": {"meta.count_like": -1}}, ) + DB.activities.update_one({"remote_id": like.id}, {"$set": {"meta.undo": True}}) @ensure_it_is_me def outbox_like(self, as_actor: ap.Person, like: ap.Like) -> None: @@ -199,6 +200,7 @@ class MicroblogPubBackend(Backend): {"activity.object.id": obj.id}, {"$inc": {"meta.count_like": -1}, "$set": {"meta.liked": False}}, ) + DB.activities.update_one({"remote_id": like.id}, {"$set": {"meta.undo": True}}) @ensure_it_is_me def inbox_announce(self, as_actor: ap.Person, announce: ap.Announce) -> None: @@ -228,6 +230,9 @@ class MicroblogPubBackend(Backend): DB.activities.update_one( {"activity.object.id": obj.id}, {"$inc": {"meta.count_boost": -1}} ) + DB.activities.update_one( + {"remote_id": announce.id}, {"$set": {"meta.undo": True}} + ) @ensure_it_is_me def outbox_announce(self, as_actor: ap.Person, announce: ap.Announce) -> None: @@ -246,6 +251,9 @@ class MicroblogPubBackend(Backend): DB.activities.update_one( {"activity.object.id": obj.id}, {"$set": {"meta.boosted": False}} ) + DB.activities.update_one( + {"remote_id": announce.id}, {"$set": {"meta.undo": True}} + ) @ensure_it_is_me def inbox_delete(self, as_actor: ap.Person, delete: ap.Delete) -> None: diff --git a/templates/index.html b/templates/index.html index 115e65e..10ba52f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,7 +25,21 @@ {% if item | has_type('Announce') %} {% set boost_actor = item.activity.actor | get_actor %} -
+ {% if session.logged_in %} +
+
+ {% endif %} {% if item.meta.object %} {{ utils.display_note(item.meta.object, ui=False) }} {% endif %} diff --git a/templates/liked.html b/templates/liked.html index c8bf71e..8255fdf 100644 --- a/templates/liked.html +++ b/templates/liked.html @@ -8,6 +8,17 @@ +