From 2edde060420f6e36a17b26839c9a95949d8b8d69 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 7 Apr 2018 21:44:55 +0000 Subject: [PATCH] user: strip leading @ from user query when searching for users if present closes #117 --- lib/pleroma/user.ex | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.45.2