From 459e75a9dbf1a603e040bedc639f5209184be5ce Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 14 Mar 2024 16:55:35 +0000 Subject: [PATCH] [bugfix] only check replyTo visibility during permission checks IF status is local (#2757) --- internal/federation/dereferencing/status.go | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/federation/dereferencing/status.go b/internal/federation/dereferencing/status.go index c8012178c..769539a2f 100644 --- a/internal/federation/dereferencing/status.go +++ b/internal/federation/dereferencing/status.go @@ -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 }