Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
2edde060
Commit
2edde060
authored
Apr 07, 2018
by
kaniini
Browse files
user: strip leading @ from user query when searching for users if present
closes
#117
parent
8f9bcc4a
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
2edde060
...
@@ -375,6 +375,9 @@ def get_recipients_from_activity(%Activity{recipients: to}) do
...
@@ -375,6 +375,9 @@ def get_recipients_from_activity(%Activity{recipients: to}) do
end
end
def
search
(
query
,
resolve
)
do
def
search
(
query
,
resolve
)
do
# strip the beginning @ off if there is a query
query
=
String
.
trim_leading
(
query
,
"@"
)
if
resolve
do
if
resolve
do
User
.
get_or_fetch_by_nickname
(
query
)
User
.
get_or_fetch_by_nickname
(
query
)
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment