1 // Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
2 // Use of this source code is governed by the MIT license that can be
3 // found in the LICENSE file.
9 // eventmask uses ei to create a new event which contains internal flags used by
10 // notify package logic.
11 func eventmask(ei EventInfo, extra Event) Event {
12 return ei.Event() | extra
15 // matches reports a match only when:
17 // - for user events, when event is present in the given set
18 // - for internal events, when additionally both event and set have omit bit set
20 // Internal events must not be sent to user channels and vice versa.
21 func matches(set, event Event) bool {
22 return (set&omit)^(event&omit) == 0 && set&event == event