From 56da9143402436f7ec195fe477cd45d45dcc0aa4 Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Wed, 8 Mar 2023 19:01:21 +0100 Subject: [PATCH] Allow to set default reply visibility (#531) --- activities/views/compose.py | 4 +++- core/models/config.py | 1 + users/views/settings/interface.py | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/activities/views/compose.py b/activities/views/compose.py index 96c9e11..c5cba65 100644 --- a/activities/views/compose.py +++ b/activities/views/compose.py @@ -123,7 +123,9 @@ class Compose(FormView): if self.reply_to: initial["reply_to"] = self.reply_to.pk if self.reply_to.visibility == Post.Visibilities.public: - initial["visibility"] = Post.Visibilities.unlisted + initial[ + "visibility" + ] = self.request.identity.config_identity.default_reply_visibility else: initial["visibility"] = self.reply_to.visibility initial["content_warning"] = self.reply_to.summary diff --git a/core/models/config.py b/core/models/config.py index 82b6193..0c79f80 100644 --- a/core/models/config.py +++ b/core/models/config.py @@ -246,6 +246,7 @@ class Config(models.Model): toot_mode: bool = False default_post_visibility: int = 0 # Post.Visibilities.public + default_reply_visibility: int = 1 # Post.Visibilities.unlisted visible_follows: bool = True light_theme: bool = False diff --git a/users/views/settings/interface.py b/users/views/settings/interface.py index 0b31f22..556e850 100644 --- a/users/views/settings/interface.py +++ b/users/views/settings/interface.py @@ -16,6 +16,11 @@ class InterfacePage(SettingsPage): "help_text": "Visibility to use as default for new posts.", "choices": Post.Visibilities.choices, }, + "default_reply_visibility": { + "title": "Default Reply Visibility", + "help_text": "Visibility to use as default for replies.", + "choices": Post.Visibilities.choices, + }, "visible_reaction_counts": { "title": "Show Boost and Like Counts", "help_text": "Disable to hide the number of Likes and Boosts on a 'Post'", @@ -40,7 +45,7 @@ class InterfacePage(SettingsPage): } layout = { - "Posting": ["toot_mode", "default_post_visibility"], + "Posting": ["toot_mode", "default_post_visibility", "default_reply_visibility"], "Wellness": ["infinite_scroll", "visible_reaction_counts", "expand_linked_cws"], "Appearance": ["light_theme", "custom_css"], }