Improved replies support

This commit is contained in:
Thomas Sileo 2022-06-24 11:33:05 +02:00
parent 7293160b6f
commit baceb6be6c
11 changed files with 67 additions and 17 deletions

View file

@ -54,15 +54,14 @@ class Object:
@property
def context(self) -> str | None:
return self.ap_object.get("context")
return self.ap_object.get("context") or self.ap_object.get("conversation")
@property
def sensitive(self) -> bool:
return self.ap_object.get("sensitive", False)
@property
def attachments_old(self) -> list["Attachment"]:
# TODO: set img_src with the proxy URL (proxy_url?)
def attachments(self) -> list["Attachment"]:
attachments = []
for obj in self.ap_object.get("attachment", []):
proxied_url = _proxied_url(obj["url"])