Visibility tweaks

This commit is contained in:
Thomas Sileo
2019-09-01 21:38:38 +02:00
parent 52bc600832
commit 5b1e776fa2
2 changed files with 33 additions and 29 deletions

View File

@@ -46,6 +46,7 @@ class MetaKey(Enum):
OBJECT_ACTOR_HASH = "object_actor_hash"
PUBLIC = "public"
PINNED = "pinned"
HASHTAGS = "hashtags"
MENTIONS = "mentions"
@@ -100,6 +101,10 @@ def follow_request_accepted() -> _SubQuery:
return flag(MetaKey.FOLLOW_STATUS, FollowStatus.ACCEPTED.value)
def not_in_reply_to() -> _SubQuery:
return {"activity.object.inReplyTo": None}
def not_undo() -> _SubQuery:
return flag(MetaKey.UNDO, False)
@@ -108,6 +113,10 @@ def not_deleted() -> _SubQuery:
return flag(MetaKey.DELETED, False)
def pinned() -> _SubQuery:
return flag(MetaKey.PINNED, True)
def by_actor(actor: ap.BaseActivity) -> _SubQuery:
return flag(MetaKey.ACTOR_ID, actor.id)