mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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:
@@ -199,10 +199,14 @@ func (p *processor) processNote(ctx context.Context, note string, accountID stri
|
||||
return "", err
|
||||
}
|
||||
|
||||
mentionStrings := util.DeriveMentionsFromText(note)
|
||||
mentions, err := p.db.MentionStringsToMentions(ctx, mentionStrings, accountID, "")
|
||||
if err != nil {
|
||||
return "", err
|
||||
mentionStrings := util.DeriveMentionNamesFromText(note)
|
||||
mentions := []*gtsmodel.Mention{}
|
||||
for _, mentionString := range mentionStrings {
|
||||
mention, err := p.parseMention(ctx, mentionString, accountID, "")
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
mentions = append(mentions, mention)
|
||||
}
|
||||
|
||||
// TODO: support emojis in account notes
|
||||
|
Reference in New Issue
Block a user