mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-22 11:46:40 +00:00
[bugfix] only check replyTo visibility during permission checks IF status is local (#2757)
This commit is contained in:
parent
92bf1f779b
commit
459e75a9db
|
@ -621,19 +621,23 @@ func (d *Dereferencer) isPermittedStatus(
|
|||
return onFail()
|
||||
}
|
||||
|
||||
// Check visibility of inReplyTo to status author.
|
||||
permitted, err = d.visibility.StatusVisible(ctx,
|
||||
status.Account,
|
||||
status.InReplyTo,
|
||||
)
|
||||
if err != nil {
|
||||
return false, gtserror.Newf("error checking in-reply-to visibility: %w", err)
|
||||
// Default to true
|
||||
permitted = true
|
||||
|
||||
if *status.InReplyTo.Local {
|
||||
// Check visibility of inReplyTo to status author.
|
||||
permitted, err = d.visibility.StatusVisible(ctx,
|
||||
status.Account,
|
||||
status.InReplyTo,
|
||||
)
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue