// FilterPassIfUserInChat event is passable only if user is in same chat as event occurs in
// or if event global

FilterPassIfUserInChat event is passable only if user is in same chat as event occurs in
or if event global
// FilterPassIfUserInChat event is passable only if user is in same chat as event occurs in // or if event global
func FilterPassIfUserInChat(chatDB db.ChatDB, username string) FilterPass {
	return FilterPass(func(e events.Event) bool {
		inChat, err := e.InChat()
		if err != nil {
			return err == er.ErrGlobalEvent
		}
		return chatDB.IsInChat(inChat, username)
	})
}
func FilterPassIfUserInChat ( chatDB db . ChatDB , username string ) FilterPass { return FilterPass ( func ( e events . Event ) bool { inChat , err := e . InChat ( ) if err != nil { return err == er . ErrGlobalEvent } return chatDB . IsInChat ( inChat , username ) } ) }
FilterPassIfUserInChat event is passable only if user is in same chat as event occurs in
or if event global
FilterPassIfUserInChat event is passable only if user is in same chat as event occurs in or if event global