From 6a60a2a6a68313bd3e4888386d570ec32555070d Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Mon, 17 Feb 2020 19:34:11 +0100 Subject: [PATCH] fix url search returning the same post indefinitely (#1695) --- .../tusky/components/search/adapter/SearchDataSource.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/search/adapter/SearchDataSource.kt b/app/src/main/java/com/keylesspalace/tusky/components/search/adapter/SearchDataSource.kt index f170f35e..2b706288 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/search/adapter/SearchDataSource.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/search/adapter/SearchDataSource.kt @@ -97,12 +97,12 @@ class SearchDataSource( .subscribe( { data -> // Working around Mastodon bug where exact match is returned no matter - // which offset is requested (so if we seach for a full username, it's + // which offset is requested (so if we search for a full username, it's // infinite) // see https://github.com/tootsuite/mastodon/issues/11365 - val res = if (data.accounts.size == 1 - && data.accounts[0].username - .equals(searchRequest, ignoreCase = true)) { + // see https://github.com/tootsuite/mastodon/issues/13083 + val res = if ((data.accounts.size == 1 && data.accounts[0].username.equals(searchRequest, ignoreCase = true)) + || (data.statuses.size == 1 && data.statuses[0].url.equals(searchRequest))) { listOf() } else { parser(data)