mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:42:24 -05: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:
parent
983e696bd6
commit
37d310f981
16 changed files with 420 additions and 183 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue