mirror of
1
Fork 0

[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
1 changed files with 13 additions and 9 deletions

View File

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