fix: bsky post when reply delete

This commit is contained in:
xtaodada 2024-10-20 15:38:30 +08:00
parent 807b4c05b9
commit 68c546914c
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -166,6 +166,7 @@ class HumanPost(BaseModel, frozen=False):
parent_post = None parent_post = None
if data.reply: if data.reply:
is_reply = True is_reply = True
if hasattr(data.reply.parent, "post"):
parent_post = HumanPost.parse_view(data.reply.parent) parent_post = HumanPost.parse_view(data.reply.parent)
elif data.reason: elif data.reason:
is_repost = True is_repost = True
@ -186,6 +187,7 @@ class HumanPost(BaseModel, frozen=False):
parent_post = None parent_post = None
if data.parent: if data.parent:
is_reply = True is_reply = True
if hasattr(data.parent, "post"):
parent_post = HumanPost.parse_view(data.parent.post) parent_post = HumanPost.parse_view(data.parent.post)
elif data.post.embed and isinstance(data.post.embed, BskyViewRecord): elif data.post.embed and isinstance(data.post.embed, BskyViewRecord):
is_quote = True is_quote = True