mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-15 00:27:29 -06:00
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
This commit is contained in:
parent
071eca20ce
commit
2dc9fc1626
713 changed files with 98694 additions and 22704 deletions
|
|
@ -19,6 +19,7 @@
|
|||
package text
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"html"
|
||||
"strings"
|
||||
|
|
@ -59,7 +60,7 @@ func postformat(in string) string {
|
|||
return mini
|
||||
}
|
||||
|
||||
func (f *formatter) ReplaceTags(in string, tags []*gtsmodel.Tag) string {
|
||||
func (f *formatter) ReplaceTags(ctx context.Context, in string, tags []*gtsmodel.Tag) string {
|
||||
return util.HashtagFinderRegex.ReplaceAllStringFunc(in, func(match string) string {
|
||||
// we have a match
|
||||
matchTrimmed := strings.TrimSpace(match)
|
||||
|
|
@ -88,7 +89,7 @@ func (f *formatter) ReplaceTags(in string, tags []*gtsmodel.Tag) string {
|
|||
})
|
||||
}
|
||||
|
||||
func (f *formatter) ReplaceMentions(in string, mentions []*gtsmodel.Mention) string {
|
||||
func (f *formatter) ReplaceMentions(ctx context.Context, in string, mentions []*gtsmodel.Mention) string {
|
||||
for _, menchie := range mentions {
|
||||
// make sure we have a target account, either by getting one pinned on the mention,
|
||||
// or by pulling it from the database
|
||||
|
|
@ -97,8 +98,8 @@ func (f *formatter) ReplaceMentions(in string, mentions []*gtsmodel.Mention) str
|
|||
// got it from the mention
|
||||
targetAccount = menchie.OriginAccount
|
||||
} else {
|
||||
a := >smodel.Account{}
|
||||
if err := f.db.GetByID(menchie.TargetAccountID, a); err == nil {
|
||||
a, err := f.db.GetAccountByID(ctx, menchie.TargetAccountID)
|
||||
if err == nil {
|
||||
// got it from the db
|
||||
targetAccount = a
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue