move to ulid

This commit is contained in:
tsmethurst 2021-06-11 18:38:58 +02:00
commit 26ee190338
51 changed files with 398 additions and 514 deletions

View file

@ -4,11 +4,11 @@ import (
"errors"
"fmt"
"github.com/google/uuid"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/id"
"github.com/superseriousbusiness/gotosocial/internal/util"
)
@ -66,7 +66,10 @@ func (p *processor) Fave(account *gtsmodel.Account, targetStatusID string) (*api
}
if newFave {
thisFaveID := uuid.NewString()
thisFaveID, err := id.NewRandomULID()
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
// we need to create a new fave in the database
gtsFave := &gtsmodel.StatusFave{