summaryrefslogtreecommitdiff
path: root/internal/processing/account/delete.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-20 12:26:56 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-20 12:26:56 +0200
commit4920229a3b6e1d7dde536bc9ff766542b05d935c (patch)
treea9423beccec5331c372f01eedf38949dfb171e9e /internal/processing/account/delete.go
parentText/status parsing fixes (#141) (diff)
downloadgotosocial-4920229a3b6e1d7dde536bc9ff766542b05d935c.tar.xz
Database updates (#144)
* start moving some database stuff around * continue moving db stuff around * more fiddling * more updates * and some more * and yet more * i broke SOMETHING but what, it's a mystery * tidy up * vendor ttlcache * use ttlcache * fix up some tests * rename some stuff * little reminder * some more updates
Diffstat (limited to 'internal/processing/account/delete.go')
-rw-r--r--internal/processing/account/delete.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/processing/account/delete.go b/internal/processing/account/delete.go
index 65ac02291..e8840abae 100644
--- a/internal/processing/account/delete.go
+++ b/internal/processing/account/delete.go
@@ -133,9 +133,9 @@ func (p *processor) Delete(account *gtsmodel.Account, origin string) error {
var maxID string
selectStatusesLoop:
for {
- statuses, err := p.db.GetStatusesForAccount(account.ID, 20, false, maxID, false, false)
+ statuses, err := p.db.GetAccountStatuses(account.ID, 20, false, maxID, false, false)
if err != nil {
- if _, ok := err.(db.ErrNoEntries); ok {
+ if err == db.ErrNoEntries {
// no statuses left for this instance so we're done
l.Infof("Delete: done iterating through statuses for account %s", account.Username)
break selectStatusesLoop
@@ -147,7 +147,7 @@ selectStatusesLoop:
for i, s := range statuses {
// pass the status delete through the client api channel for processing
- s.GTSAuthorAccount = account
+ s.Account = account
l.Debug("putting status in the client api channel")
p.fromClientAPI <- gtsmodel.FromClientAPI{
APObjectType: gtsmodel.ActivityStreamsNote,
@@ -158,7 +158,7 @@ selectStatusesLoop:
}
if err := p.db.DeleteByID(s.ID, s); err != nil {
- if _, ok := err.(db.ErrNoEntries); !ok {
+ if err != db.ErrNoEntries {
// actual error has occurred
l.Errorf("Delete: db error status %s for account %s: %s", s.ID, account.Username, err)
break selectStatusesLoop
@@ -168,7 +168,7 @@ selectStatusesLoop:
// if there are any boosts of this status, delete them as well
boosts := []*gtsmodel.Status{}
if err := p.db.GetWhere([]db.Where{{Key: "boost_of_id", Value: s.ID}}, &boosts); err != nil {
- if _, ok := err.(db.ErrNoEntries); !ok {
+ if err != db.ErrNoEntries {
// an actual error has occurred
l.Errorf("Delete: db error selecting boosts of status %s for account %s: %s", s.ID, account.Username, err)
break selectStatusesLoop
@@ -190,7 +190,7 @@ selectStatusesLoop:
}
if err := p.db.DeleteByID(b.ID, b); err != nil {
- if _, ok := err.(db.ErrNoEntries); !ok {
+ if err != db.ErrNoEntries {
// actual error has occurred
l.Errorf("Delete: db error deleting boost with id %s: %s", b.ID, err)
break selectStatusesLoop