code: func (c *EventHistoryCollector) entityMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool {
  	e := spec.Entity
  	if e == nil {
  		return true
  	}
  
  	isRootFolder := c.m.root == e.Entity
  
  	switch e.Recursion {
  	case types.EventFilterSpecRecursionOptionSelf:
  		return isRootFolder || eventFilterSelf(event, e.Entity)
  	case types.EventFilterSpecRecursionOptionChildren:
  		return eventFilterChildren(event, e.Entity)
  	case types.EventFilterSpecRecursionOptionAll:
  		if isRootFolder || eventFilterSelf(event, e.Entity) {
  			return true
  		}
  		return eventFilterChildren(event, e.Entity)
  	}
  
  	return false
  }
docs: // entityMatches returns true if the spec Entity filter matches the event.