From: William Pitcock Date: Sat, 7 Apr 2018 21:44:55 +0000 (+0000) Subject: user: strip leading @ from user query when searching for users if present X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2edde060420f6e36a17b26839c9a95949d8b8d69;p=akkoma user: strip leading @ from user query when searching for users if present closes #117 --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index abeb169d9..e959fe677 100644 --- 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