~ihabunek/toot-discuss

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH tooi] StatusDetail: mark Hometown local-only posts

Lexi Winter <lexi@le-Fay.ORG>
Details
Message ID
<20240109142238.76629-1-lexi@le-Fay.ORG>
DKIM signature
missing
Download raw message
Patch: +9 -1
These are indicated by the local_only flag in the status object.
---
 tooi/entities.py              | 2 ++
 tooi/widgets/status_detail.py | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/tooi/entities.py b/tooi/entities.py
index e595272..e2331c6 100644
--- a/tooi/entities.py
+++ b/tooi/entities.py
@@ -252,6 +252,8 @@ class Status:
    bookmarked: Optional[bool]
    pinned: Optional[bool]
    filtered: Optional[list[FilterResult]]
    # Hometown unfederated posts
    local_only: Optional[bool]

    @property
    def original(self) -> "Status":
diff --git a/tooi/widgets/status_detail.py b/tooi/widgets/status_detail.py
index 35a0453..8116a76 100644
--- a/tooi/widgets/status_detail.py
+++ b/tooi/widgets/status_detail.py
@@ -214,6 +214,12 @@ class StatusMeta(Static):
        self.status = status
        super().__init__()

    def visibility_string(self, status):
        vis = f"{status.visibility.capitalize()}"
        if status.local_only:
            vis += " (local only)"
        return vis

    def render(self):
        status = self.status.original
        parts = [
@@ -221,7 +227,7 @@ class StatusMeta(Static):
            f"{status.reblogs_count} boosts",
            f"{status.favourites_count} favourites",
            f"{status.replies_count} replies",
            f"{status.visibility.capitalize()}",
            self.visibility_string(status),
        ]
        return " ยท ".join(parts)

-- 
2.43.0
Details
Message ID
<c38035a9-80b7-4c5d-beee-e8c02130e06d@app.fastmail.com>
In-Reply-To
<20240109142238.76629-1-lexi@le-Fay.ORG> (view parent)
DKIM signature
missing
Download raw message
Thanks!

-- Ivan
Reply to thread Export thread (mbox)