mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 11:14:28 +00:00
Bugfixes
This commit is contained in:
parent
ef7a887146
commit
c383259296
1 changed files with 23 additions and 3 deletions
|
@ -241,7 +241,15 @@ class MicroblogPubBackend(Backend):
|
||||||
)
|
)
|
||||||
obj = delete.get_object()
|
obj = delete.get_object()
|
||||||
if obj.ACTIVITY_TYPE != ap.ActivityType.NOTE:
|
if obj.ACTIVITY_TYPE != ap.ActivityType.NOTE:
|
||||||
obj = self.fetch_iri(delete.get_object().id)
|
obj = DB.inbox.find_one(
|
||||||
|
{
|
||||||
|
"activity.object.id": delete.get_object().id,
|
||||||
|
"type": ap.ActivityType.CREATE.value,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
logger.info(f"inbox_delete handle_replies obj={obj!r}")
|
||||||
|
if obj:
|
||||||
self._handle_replies_delete(as_actor, obj)
|
self._handle_replies_delete(as_actor, obj)
|
||||||
|
|
||||||
# FIXME(tsileo): handle threads
|
# FIXME(tsileo): handle threads
|
||||||
|
@ -257,6 +265,18 @@ class MicroblogPubBackend(Backend):
|
||||||
{"activity.object.id": delete.get_object().id},
|
{"activity.object.id": delete.get_object().id},
|
||||||
{"$set": {"meta.deleted": True}},
|
{"$set": {"meta.deleted": True}},
|
||||||
)
|
)
|
||||||
|
obj = delete.get_object()
|
||||||
|
if delete.get_object().ACTIVITY_TYPE != ap.ActivityType.NOTE:
|
||||||
|
obj = ap.parse_activity(
|
||||||
|
DB.outbox.find_one(
|
||||||
|
{
|
||||||
|
"activity.object.id": delete.get_object().id,
|
||||||
|
"type": ap.ActivityType.CREATE.value,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
).get_object()
|
||||||
|
|
||||||
|
self._handle_replies_delete(as_actor, obj)
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def inbox_update(self, as_actor: ap.Person, update: ap.Update) -> None:
|
def inbox_update(self, as_actor: ap.Person, update: ap.Update) -> None:
|
||||||
|
@ -305,7 +325,7 @@ class MicroblogPubBackend(Backend):
|
||||||
self._handle_replies(as_actor, create)
|
self._handle_replies(as_actor, create)
|
||||||
|
|
||||||
@ensure_it_is_me
|
@ensure_it_is_me
|
||||||
def _handle_replies_delete(self, as_actor: ap.Person, note: ap.Create) -> None:
|
def _handle_replies_delete(self, as_actor: ap.Person, note: ap.Note) -> None:
|
||||||
in_reply_to = note.inReplyTo
|
in_reply_to = note.inReplyTo
|
||||||
if not in_reply_to:
|
if not in_reply_to:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue