From a5d3aa488b21579d458473d33cbed124df22391a Mon Sep 17 00:00:00 2001 From: silverpill Date: Sun, 13 Feb 2022 18:16:51 +0000 Subject: [PATCH] Require replies to non-public posts to have direct visibility --- src/mastodon_api/statuses/views.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mastodon_api/statuses/views.rs b/src/mastodon_api/statuses/views.rs index 8446ebe..d8800a5 100644 --- a/src/mastodon_api/statuses/views.rs +++ b/src/mastodon_api/statuses/views.rs @@ -95,8 +95,9 @@ async fn create_status( }, Err(other_error) => return Err(other_error.into()), }; - if post_data.visibility != Visibility::Direct && post_data.visibility != in_reply_to.visibility { - return Err(ValidationError("post visibility doesn't match the parent").into()); + if in_reply_to.visibility != Visibility::Public && + post_data.visibility != Visibility::Direct { + return Err(ValidationError("reply must have direct visibility").into()); }; if post_data.visibility != Visibility::Public { let mut in_reply_to_audience: Vec<_> = in_reply_to.mentions.iter()