mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 11:12:25 -05:00
Compare commits
2 commits
5b95636993
...
c6044d0142
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6044d0142 | ||
|
|
03fc6eaf39 |
2 changed files with 27 additions and 4 deletions
|
|
@ -244,6 +244,12 @@ func (pr1 *PolicyRules) DifferentFrom(pr2 *PolicyRules) bool {
|
|||
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
|
||||
// differs between the two.
|
||||
if slices.Compare(
|
||||
|
|
|
|||
|
|
@ -2438,8 +2438,8 @@ func (c *Converter) InteractionReqToASAuthorization(
|
|||
}
|
||||
|
||||
// appendASInteractionAuthorization is a utility function
|
||||
// that sets `approvedBy`, and `likeAuthorization`,
|
||||
// `replyAuthorization`, or `announceAuthorization`.
|
||||
// that sets `approvedBy`, and (if possible) `likeAuthorization`,
|
||||
// `replyAuthorization`, and/or `announceAuthorization`.
|
||||
func (c *Converter) appendASInteractionAuthorization(
|
||||
ctx context.Context,
|
||||
approvedByURIStr string,
|
||||
|
|
@ -2458,11 +2458,28 @@ func (c *Converter) appendASInteractionAuthorization(
|
|||
gtscontext.SetBarebones(ctx),
|
||||
approvedByURIStr,
|
||||
)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, db.ErrNoEntries) {
|
||||
return gtserror.Newf("db error checking for int req: %w", err)
|
||||
}
|
||||
|
||||
// Make sure it's actually accepted.
|
||||
// If the interaction request is nil,
|
||||
// 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() {
|
||||
return gtserror.Newf(
|
||||
"approvedByURIStr %s corresponded to not-accepted interaction request %s",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue