aboutsummaryrefslogtreecommitdiffstats
path: root/cache/filter.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-04-05 16:28:41 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-04-05 16:56:08 +0200
commit1d00ded250102c23c0a106e14d88875d342f7880 (patch)
tree2d27d6bdbcd74bffeeed48b62e8c046085ecbb94 /cache/filter.go
parent98169d5ad193fe776c29cc40dcd7103bb13e9b7d (diff)
downloadgit-bug-1d00ded250102c23c0a106e14d88875d342f7880.tar.gz
implement identityExcerpt match method and integrate it into filters
Update docs
Diffstat (limited to 'cache/filter.go')
-rw-r--r--cache/filter.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/cache/filter.go b/cache/filter.go
index ca70bb2a..27e92cf3 100644
--- a/cache/filter.go
+++ b/cache/filter.go
@@ -33,10 +33,7 @@ func AuthorFilter(query string) Filter {
panic("missing identity in the cache")
}
- return query == author.Id ||
- query == author.HumanId() ||
- strings.Contains(strings.ToLower(author.Name), query) ||
- strings.Contains(strings.ToLower(author.Login), query)
+ return author.Match(query)
}
// Legacy identity support
@@ -68,10 +65,7 @@ func ActorFilter(query string) Filter {
panic("missing identity in the cache")
}
- if query == identityExcerpt.Id ||
- query == identityExcerpt.HumanId() ||
- strings.Contains(strings.ToLower(identityExcerpt.Name), query) ||
- query == strings.ToLower(identityExcerpt.Login) {
+ if identityExcerpt.Match(query) {
return true
}
}
@@ -90,10 +84,7 @@ func ParticipantFilter(query string) Filter {
panic("missing identity in the cache")
}
- if query == identityExcerpt.Id ||
- query == identityExcerpt.HumanId() ||
- strings.Contains(strings.ToLower(identityExcerpt.Name), query) ||
- query == strings.ToLower(identityExcerpt.Login) {
+ if identityExcerpt.Match(query) {
return true
}
}