user: strip leading @ from user query when searching for users if present
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 7 Apr 2018 21:44:55 +0000 (21:44 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 9 Apr 2018 07:42:37 +0000 (02:42 -0500)
closes #117

lib/pleroma/user.ex

index abeb169d900b6557d2d9bcaaaa0573d69444b509..e959fe67738bdc33f2d38238c4495d07a1f9e70d 100644 (file)
@@ -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