~tsileo/microblog.pub

c8012ee8f33b52eb00c7a18bc5ffb19e8747dcb9 — Thomas Sileo 8 months ago 3998d4e
Fix/tweak DMs sections
2 files changed, 6 insertions(+), 2 deletions(-)

M blueprints/admin.py
M core/meta.py
M blueprints/admin.py => blueprints/admin.py +2 -2
@@ 31,7 31,7 @@ from core.db import find_one_activity
from core.meta import by_object_id
from core.meta import by_remote_id
from core.meta import by_type
from core.meta import by_visibility
from core.meta import by_object_visibility
from core.meta import follow_request_accepted
from core.meta import in_outbox
from core.meta import not_poll_answer


@@ 384,7 384,7 @@ def admin_direct_messages() -> _Response:
        {
            **not_poll_answer(),
            **by_type(ap.ActivityType.CREATE),
            **by_visibility(ap.Visibility.DIRECT),
            **by_object_visibility(ap.Visibility.DIRECT),
        }
    ).sort("meta.published", -1)


M core/meta.py => core/meta.py +4 -0
@@ 142,6 142,10 @@ def by_visibility(vis: ap.Visibility) -> _SubQuery:
    return flag(MetaKey.VISIBILITY, vis.name)


def by_object_visibility(vis: ap.Visibility) -> _SubQuery:
    return flag(MetaKey.OBJECT_VISIBILITY, vis.name)


def by_hashtag(ht: str) -> _SubQuery:
    return flag(MetaKey.HASHTAGS, ht)