From 98169d5ad193fe776c29cc40dcd7103bb13e9b7d Mon Sep 17 00:00:00 2001 From: Amine Hilaly Date: Fri, 5 Apr 2019 15:29:14 +0200 Subject: Support query with identity ID and truncated ID --- cache/filter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cache') diff --git a/cache/filter.go b/cache/filter.go index b26e7ae1..ca70bb2a 100644 --- a/cache/filter.go +++ b/cache/filter.go @@ -33,7 +33,9 @@ func AuthorFilter(query string) Filter { panic("missing identity in the cache") } - return strings.Contains(strings.ToLower(author.Name), query) || + return query == author.Id || + query == author.HumanId() || + strings.Contains(strings.ToLower(author.Name), query) || strings.Contains(strings.ToLower(author.Login), query) } @@ -67,6 +69,7 @@ func ActorFilter(query string) Filter { } if query == identityExcerpt.Id || + query == identityExcerpt.HumanId() || strings.Contains(strings.ToLower(identityExcerpt.Name), query) || query == strings.ToLower(identityExcerpt.Login) { return true @@ -88,6 +91,7 @@ func ParticipantFilter(query string) Filter { } if query == identityExcerpt.Id || + query == identityExcerpt.HumanId() || strings.Contains(strings.ToLower(identityExcerpt.Name), query) || query == strings.ToLower(identityExcerpt.Login) { return true -- cgit