Activity page shows create events only

This commit is contained in:
2019-08-27 15:03:29 +09:00
parent f1ccc6c0c6
commit b13b337990
6 changed files with 35 additions and 17 deletions

View File

@ -61,3 +61,16 @@ func StreamActivityCreates() <-chan *ActivityCreate {
return channel
}
// FilterActivityCreates filters all ActivityCreates by a custom function.
func FilterActivityCreates(filter func(Activity) bool) []Activity {
var filtered []Activity
for obj := range StreamActivityCreates() {
if filter(obj) {
filtered = append(filtered, obj)
}
}
return filtered
}