summaryrefslogtreecommitdiff
path: root/internal/processing/account/update.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-03-29 11:54:56 +0200
committerLibravatar GitHub <noreply@github.com>2022-03-29 11:54:56 +0200
commit37d310f981f3e26bc643aeabac134b591c84455a (patch)
tree041f5db16254b5257471bcac0730ac9d93ce13d5 /internal/processing/account/update.go
parent[feature/security] Add systemd sandboxing options to harden security (#440) (diff)
downloadgotosocial-37d310f981f3e26bc643aeabac134b591c84455a.tar.xz
[feature] Dereference remote mentions when the account is not already known (#442)v0.2.2
* 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
Diffstat (limited to 'internal/processing/account/update.go')
-rw-r--r--internal/processing/account/update.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/processing/account/update.go b/internal/processing/account/update.go
index a96b44bef..a0056563b 100644
--- a/internal/processing/account/update.go
+++ b/internal/processing/account/update.go
@@ -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