fix mention extracting when no domain exists (usually intra-instance mentions) (#272)

* fix mention extracting when no domain exists (usually when intra-instance mentions)

Signed-off-by: kim <grufwub@gmail.com>

* fix search logic to match new mention matching logic

Signed-off-by: kim <grufwub@gmail.com>

* appease the linter :p

Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2021-10-17 13:19:49 +01:00 committed by GitHub
commit 7e4c3fa5c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 35 deletions

View file

@ -47,7 +47,7 @@ const (
)
var (
mentionName = `^@(\w+)(?:@([a-zA-Z0-9_\-\.:]+)?)$`
mentionName = `^@(\w+)(?:@([a-zA-Z0-9_\-\.:]+))?$`
// MentionName captures the username and domain part from a mention string
// such as @whatever_user@example.org, returning whatever_user and example.org (without the @ symbols)
MentionName = regexp.MustCompile(mentionName)