From 836f3c828307f03563d181c526af6141b886111b Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" <9155111+ashwinvis@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:11:11 +0100 Subject: [PATCH 1/2] Format docstring for visibility parameter Without this change it is easy to get confused while reading the online docs. https://mastodonpy.readthedocs.io/en/stable/05_statuses.html#status-post --- mastodon/statuses.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mastodon/statuses.py b/mastodon/statuses.py index fbe4fba..ba33298 100644 --- a/mastodon/statuses.py +++ b/mastodon/statuses.py @@ -199,15 +199,16 @@ class Mastodon(Internals): should be marked as sensitive, which hides it by default on the Mastodon web front-end. - The visibility parameter is a string value and accepts any of: - 'direct' - post will be visible only to mentioned users - 'private' - post will be visible only to followers - 'unlisted' - post will be public but not appear on the public timeline - 'public' - post will be public + The `visibility` parameter is a string value and accepts any of: + + * ``'direct'`` - post will be visible only to **mentioned users** + * ``'private'`` - post will be visible only to **followers** + * ``'unlisted'`` - post will be **public but not appear on the public timeline** + * ``'public'`` - post will be **public** - If not passed in, visibility defaults to match the current account's + If not passed in, `visibility` defaults to match the current account's default-privacy setting (starting with Mastodon version 1.6) or its - locked setting - private if the account is locked, public otherwise + locked setting - ``'private'`` if the account is locked, ``'public'`` otherwise (for Mastodon versions lower than 1.6). The `spoiler_text` parameter is a string to be shown as a warning before From b09c8915da7050ed8c510cc0e5ac69d4edd128b6 Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" <9155111+ashwinvis@users.noreply.github.com> Date: Sat, 18 Nov 2023 23:27:34 +0100 Subject: [PATCH 2/2] Update docstring for visibility with how it is know in Mastodon's UI --- mastodon/statuses.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mastodon/statuses.py b/mastodon/statuses.py index ba33298..f3d6e81 100644 --- a/mastodon/statuses.py +++ b/mastodon/statuses.py @@ -201,11 +201,12 @@ class Mastodon(Internals): The `visibility` parameter is a string value and accepts any of: - * ``'direct'`` - post will be visible only to **mentioned users** - * ``'private'`` - post will be visible only to **followers** - * ``'unlisted'`` - post will be **public but not appear on the public timeline** - * ``'public'`` - post will be **public** + * ``'direct'`` - post will be visible only to **mentioned users**, known in Mastodon's UI as "Mentioned users only" + * ``'private'`` - post will be visible only to **followers**, known in Mastodon's UI as "Followers only" + * ``'unlisted'`` - post will be public but **will not appear** on the public timelines + * ``'public'`` - post will be public and **will appear** on public timelines +\ If not passed in, `visibility` defaults to match the current account's default-privacy setting (starting with Mastodon version 1.6) or its locked setting - ``'private'`` if the account is locked, ``'public'`` otherwise