mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
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:
@@ -565,13 +565,10 @@ func ExtractMention(i Mentionable) (*gtsmodel.Mention, error) {
|
||||
}
|
||||
|
||||
// just make sure the mention string is valid so we can handle it properly later on...
|
||||
username, domain, err := util.ExtractMentionParts(mentionString)
|
||||
_, _, err = util.ExtractMentionParts(mentionString)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if username == "" || domain == "" {
|
||||
return nil, errors.New("username or domain was empty")
|
||||
}
|
||||
mention.NameString = mentionString
|
||||
|
||||
// the href prop should be the AP URI of a user we know, eg https://example.org/users/whatever_user
|
||||
|
Reference in New Issue
Block a user