summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/delete.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/federation/federatingdb/delete.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
Pg to bun (#148)
* start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes
Diffstat (limited to 'internal/federation/federatingdb/delete.go')
-rw-r--r--internal/federation/federatingdb/delete.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/federation/federatingdb/delete.go b/internal/federation/federatingdb/delete.go
index ee9310789..11b818168 100644
--- a/internal/federation/federatingdb/delete.go
+++ b/internal/federation/federatingdb/delete.go
@@ -69,11 +69,11 @@ func (f *federatingDB) Delete(ctx context.Context, id *url.URL) error {
// in a delete we only get the URI, we can't know if we have a status or a profile or something else,
// so we have to try a few different things...
- s, err := f.db.GetStatusByURI(id.String())
+ s, err := f.db.GetStatusByURI(ctx, id.String())
if err == nil {
// it's a status
l.Debugf("uri is for status with id: %s", s.ID)
- if err := f.db.DeleteByID(s.ID, &gtsmodel.Status{}); err != nil {
+ if err := f.db.DeleteByID(ctx, s.ID, &gtsmodel.Status{}); err != nil {
return fmt.Errorf("DELETE: err deleting status: %s", err)
}
fromFederatorChan <- gtsmodel.FromFederator{
@@ -84,11 +84,11 @@ func (f *federatingDB) Delete(ctx context.Context, id *url.URL) error {
}
}
- a, err := f.db.GetAccountByURI(id.String())
+ a, err := f.db.GetAccountByURI(ctx, id.String())
if err == nil {
// it's an account
- l.Debugf("uri is for an account with id: %s", s.ID)
- if err := f.db.DeleteByID(a.ID, &gtsmodel.Account{}); err != nil {
+ l.Debugf("uri is for an account with id: %s", a.ID)
+ if err := f.db.DeleteByID(ctx, a.ID, &gtsmodel.Account{}); err != nil {
return fmt.Errorf("DELETE: err deleting account: %s", err)
}
fromFederatorChan <- gtsmodel.FromFederator{