diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-11-14 00:00:35 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-11-14 00:00:35 +0200 |
commit | ba387764ca1590625d349e74eb8a8a64d1849b67 (patch) | |
tree | bc8f02156a63eac99dcddaed38e45b7c312b40c0 /matrix/pushrules/rule.go | |
parent | cfb2cc057c32330be0ca0a68cfbd245cb2b8e31b (diff) |
Fix things
Diffstat (limited to 'matrix/pushrules/rule.go')
-rw-r--r-- | matrix/pushrules/rule.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/matrix/pushrules/rule.go b/matrix/pushrules/rule.go index 71f71e5..62318ac 100644 --- a/matrix/pushrules/rule.go +++ b/matrix/pushrules/rule.go @@ -18,7 +18,7 @@ package pushrules import ( "encoding/gob" - "maunium.net/go/gomatrix" + "maunium.net/go/mautrix" "maunium.net/go/gomuks/lib/glob" ) @@ -28,7 +28,7 @@ func init() { } type PushRuleCollection interface { - GetActions(room Room, event *gomatrix.Event) PushActionArray + GetActions(room Room, event *mautrix.Event) PushActionArray } type PushRuleArray []*PushRule @@ -40,7 +40,7 @@ func (rules PushRuleArray) SetType(typ PushRuleType) PushRuleArray { return rules } -func (rules PushRuleArray) GetActions(room Room, event *gomatrix.Event) PushActionArray { +func (rules PushRuleArray) GetActions(room Room, event *mautrix.Event) PushActionArray { for _, rule := range rules { if !rule.Match(room, event) { continue @@ -67,7 +67,7 @@ func (rules PushRuleArray) SetTypeAndMap(typ PushRuleType) PushRuleMap { return data } -func (ruleMap PushRuleMap) GetActions(room Room, event *gomatrix.Event) PushActionArray { +func (ruleMap PushRuleMap) GetActions(room Room, event *mautrix.Event) PushActionArray { var rule *PushRule var found bool switch ruleMap.Type { @@ -122,7 +122,7 @@ type PushRule struct { Pattern string `json:"pattern,omitempty"` } -func (rule *PushRule) Match(room Room, event *gomatrix.Event) bool { +func (rule *PushRule) Match(room Room, event *mautrix.Event) bool { if !rule.Enabled { return false } @@ -140,7 +140,7 @@ func (rule *PushRule) Match(room Room, event *gomatrix.Event) bool { } } -func (rule *PushRule) matchConditions(room Room, event *gomatrix.Event) bool { +func (rule *PushRule) matchConditions(room Room, event *mautrix.Event) bool { for _, cond := range rule.Conditions { if !cond.Match(room, event) { return false @@ -149,7 +149,7 @@ func (rule *PushRule) matchConditions(room Room, event *gomatrix.Event) bool { return true } -func (rule *PushRule) matchPattern(room Room, event *gomatrix.Event) bool { +func (rule *PushRule) matchPattern(room Room, event *mautrix.Event) bool { pattern, err := glob.Compile(rule.Pattern) if err != nil { return false |