Allow author of parent post to be added to audience of direct message
This commit is contained in:
parent
8e53214830
commit
5d2c3e85eb
1 changed files with 3 additions and 2 deletions
|
@ -99,9 +99,10 @@ async fn create_status(
|
|||
return Err(ValidationError("post visibility doesn't match the parent").into());
|
||||
};
|
||||
if post_data.visibility != Visibility::Public {
|
||||
let in_reply_to_mentions: Vec<_> = in_reply_to.mentions.iter()
|
||||
let mut in_reply_to_audience: Vec<_> = in_reply_to.mentions.iter()
|
||||
.map(|profile| profile.id).collect();
|
||||
if !post_data.mentions.iter().all(|id| in_reply_to_mentions.contains(id)) {
|
||||
in_reply_to_audience.push(in_reply_to.author.id);
|
||||
if !post_data.mentions.iter().all(|id| in_reply_to_audience.contains(id)) {
|
||||
return Err(ValidationError("audience can't be expanded").into());
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue