projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f9bcc4
)
user: strip leading @ from user query when searching for users if present
author
William Pitcock
<nenolod@dereferenced.org>
Sat, 7 Apr 2018 21:44:55 +0000
(21:44 +0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Mon, 9 Apr 2018 07:42:37 +0000
(
02:42
-0500)
closes #117
lib/pleroma/user.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index abeb169d900b6557d2d9bcaaaa0573d69444b509..e959fe67738bdc33f2d38238c4495d07a1f9e70d 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-375,6
+375,9
@@
defmodule Pleroma.User 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