diff --git a/tasks.py b/tasks.py index ae525ca..1d2cf11 100644 --- a/tasks.py +++ b/tasks.py @@ -48,9 +48,9 @@ def process_new_activity(self, iri: str) -> None: tag_stream = False if activity.has_type(ap.ActivityType.ANNOUNCE): - tag_stream = True try: activity.get_object() + tag_stream = True except NotAnActivityError: # Most likely on OStatus notice tag_stream = False @@ -235,7 +235,10 @@ def cache_attachments(self, iri: str) -> None: if activity.has_type(ap.ActivityType.CREATE): for attachment in activity.get_object()._data.get("attachment", []): - if attachment.get("mediaType", "").startswith("image/"): + if ( + attachment.get("mediaType", "").startswith("image/") + or attachment.get("type") == ap.ActivityType.IMAGE.value + ): MEDIA_CACHE.cache(attachment["url"], Kind.ATTACHMENT) log.info(f"attachments cached for {iri}") diff --git a/templates/utils.html b/templates/utils.html index 1e19cac..6a28002 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -54,7 +54,7 @@