user: strip leading @ from user query when searching for users if present

closes #117
This commit is contained in:
William Pitcock 2018-04-07 21:44:55 +00:00
parent 8f9bcc4ab0
commit 2edde06042

View file

@ -375,6 +375,9 @@ def get_recipients_from_activity(%Activity{recipients: to}) do
end
def search(query, resolve) do
# strip the beginning @ off if there is a query
query = String.trim_leading(query, "@")
if resolve do
User.get_or_fetch_by_nickname(query)
end