mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:52:26 -05: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:
parent
15621f5324
commit
7e4c3fa5c7
4 changed files with 23 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue