diff options
author | Amine Hilaly <hilalyamine@gmail.com> | 2019-04-05 15:29:14 +0200 |
---|---|---|
committer | Amine Hilaly <hilalyamine@gmail.com> | 2019-04-05 15:29:14 +0200 |
commit | 98169d5ad193fe776c29cc40dcd7103bb13e9b7d (patch) | |
tree | 1c03f8de1880c29c461e40c18453bb7e04b5c501 /cache/filter.go | |
parent | 5733178aba2487069caba57165cf15aca4689a9c (diff) | |
download | git-bug-98169d5ad193fe776c29cc40dcd7103bb13e9b7d.tar.gz |
Support query with identity ID and truncated ID
Diffstat (limited to 'cache/filter.go')
-rw-r--r-- | cache/filter.go | 6 |
1 files changed, 5 insertions, 1 deletions
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 |