From 2ff83ae2923aa93ccefb0fa989ae0bf138a46d77 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Sep 2018 10:12:30 +0200 Subject: Handle actors search beginning with '@' Something like @toto@example.com --- server/controllers/api/search.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/controllers/api/search.ts') diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index 28a7a04ca..58851d0b5 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts @@ -56,6 +56,9 @@ function searchVideoChannels (req: express.Request, res: express.Response) { const isURISearch = search.startsWith('http://') || search.startsWith('https://') const parts = search.split('@') + + // Handle strings like @toto@example.com + if (parts.length === 3 && parts[0].length === 0) parts.shift() const isWebfingerSearch = parts.length === 2 && parts.every(p => p.indexOf(' ') === -1) if (isURISearch || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res) -- cgit v1.2.3