Compare commits

..

No commits in common. "c6044d014283abcd2f9e0a94149de232b00df8de" and "5b956369934e448db285eb5f3e890f280cfa87de" have entirely different histories.

2 changed files with 4 additions and 27 deletions

View file

@ -244,12 +244,6 @@ func (pr1 *PolicyRules) DifferentFrom(pr2 *PolicyRules) bool {
return true return true
} }
// If they're both nil we don't
// need to check anything else.
if pr1 == nil && pr2 == nil {
return false
}
// Check if AutomaticApproval // Check if AutomaticApproval
// differs between the two. // differs between the two.
if slices.Compare( if slices.Compare(

View file

@ -2438,8 +2438,8 @@ func (c *Converter) InteractionReqToASAuthorization(
} }
// appendASInteractionAuthorization is a utility function // appendASInteractionAuthorization is a utility function
// that sets `approvedBy`, and (if possible) `likeAuthorization`, // that sets `approvedBy`, and `likeAuthorization`,
// `replyAuthorization`, and/or `announceAuthorization`. // `replyAuthorization`, or `announceAuthorization`.
func (c *Converter) appendASInteractionAuthorization( func (c *Converter) appendASInteractionAuthorization(
ctx context.Context, ctx context.Context,
approvedByURIStr string, approvedByURIStr string,
@ -2458,28 +2458,11 @@ func (c *Converter) appendASInteractionAuthorization(
gtscontext.SetBarebones(ctx), gtscontext.SetBarebones(ctx),
approvedByURIStr, approvedByURIStr,
) )
if err != nil && !errors.Is(err, db.ErrNoEntries) { if err != nil {
return gtserror.Newf("db error checking for int req: %w", err) return gtserror.Newf("db error checking for int req: %w", err)
} }
// If the interaction request is nil, // Make sure it's actually accepted.
// that means we originally sent out
// the interaction request impolitely,
// and it was accepted impolitely.
// Ie., behavior from <= v0.20.0.
//
// If this is so, just set `approvedBy`
// to given approvedByURIStr and bail,
// as there's nothing else we can do.
if intReq == nil {
if wap, ok := t.(ap.WithApprovedBy); ok {
ap.SetApprovedBy(wap, approvedByURI)
}
return nil
}
// Make sure interaction request
// has actually been accepted.
if !intReq.IsAccepted() { if !intReq.IsAccepted() {
return gtserror.Newf( return gtserror.Newf(
"approvedByURIStr %s corresponded to not-accepted interaction request %s", "approvedByURIStr %s corresponded to not-accepted interaction request %s",