[feature] Dereference remote mentions when the account is not already known (#442)

* remove mention util function from db

* add ParseMentionFunc to gtsmodel

* add parseMentionFunc to processor

* refactor search to simplify it a bit

* add parseMentionFunc to account

* add parseMentionFunc to status

* some renaming for clarity

* test dereference of unknown mentioned account
This commit is contained in:
tobi
2022-03-29 11:54:56 +02:00
committed by GitHub
parent 983e696bd6
commit 37d310f981
16 changed files with 420 additions and 183 deletions

View File

@@ -74,15 +74,17 @@ type processor struct {
filter visibility.Filter
formatter text.Formatter
fromClientAPI chan messages.FromClientAPI
parseMention gtsmodel.ParseMentionFunc
}
// New returns a new status processor.
func New(db db.DB, tc typeutils.TypeConverter, fromClientAPI chan messages.FromClientAPI) Processor {
func New(db db.DB, tc typeutils.TypeConverter, fromClientAPI chan messages.FromClientAPI, parseMention gtsmodel.ParseMentionFunc) Processor {
return &processor{
tc: tc,
db: db,
filter: visibility.NewFilter(db),
formatter: text.NewFormatter(db),
fromClientAPI: fromClientAPI,
parseMention: parseMention,
}
}