[bugfix] only check replyTo visibility during permission checks IF status is local (#2757)

This commit is contained in:
kim 2024-03-14 16:55:35 +00:00 committed by GitHub
parent 92bf1f779b
commit 459e75a9db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -621,6 +621,10 @@ func (d *Dereferencer) isPermittedStatus(
return onFail()
}
// Default to true
permitted = true
if *status.InReplyTo.Local {
// Check visibility of inReplyTo to status author.
permitted, err = d.visibility.StatusVisible(ctx,
status.Account,
@ -629,11 +633,11 @@ func (d *Dereferencer) isPermittedStatus(
if err != nil {
return false, gtserror.Newf("error checking in-reply-to visibility: %w", err)
}
}
if permitted &&
*status.InReplyTo.Replyable {
// This status is visible AND
// replyable, in this economy?!
// Status is reply-able to.
return true, nil
}