mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 00:53:16 -06:00
and some more
This commit is contained in:
parent
81ea286254
commit
896461dec3
16 changed files with 145 additions and 95 deletions
|
|
@ -6,7 +6,6 @@ import (
|
|||
"net/url"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/util"
|
||||
)
|
||||
|
|
@ -52,10 +51,8 @@ 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...
|
||||
where := []db.Where{{Key: "uri", Value: id.String()}}
|
||||
|
||||
s := >smodel.Status{}
|
||||
if err := f.db.GetWhere(where, s); err == nil {
|
||||
s, err := f.db.GetStatusByURI(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, >smodel.Status{}); err != nil {
|
||||
|
|
@ -69,8 +66,8 @@ func (f *federatingDB) Delete(ctx context.Context, id *url.URL) error {
|
|||
}
|
||||
}
|
||||
|
||||
a := >smodel.Account{}
|
||||
if err := f.db.GetWhere(where, a); err == nil {
|
||||
a, err := f.db.GetAccountByURI(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, >smodel.Account{}); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue