Skip to content

Commit

Permalink
pushrules: fix glob matching
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Aug 30, 2024
1 parent 67703cf commit 7a86cb2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/tidwall/gjson v1.17.3
github.com/tidwall/sjson v1.2.5
github.com/yuin/goldmark v1.7.4
go.mau.fi/util v0.7.1-0.20240829235756-95504af915a4
go.mau.fi/util v0.7.1-0.20240830150939-8c1e9c295943
go.mau.fi/zeroconfig v0.1.3
golang.org/x/crypto v0.26.0
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg=
github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
go.mau.fi/util v0.7.1-0.20240829235756-95504af915a4 h1:vk/X3TjGzYR9RMUpq74TuhOuR0tcXGU8y3uQL4WLD9w=
go.mau.fi/util v0.7.1-0.20240829235756-95504af915a4/go.mod h1:WuAOOV0O/otkxGkFUvfv/XE2ztegaoyM15ovS6SYbf4=
go.mau.fi/util v0.7.1-0.20240830150939-8c1e9c295943 h1:wdJ9XC/M6lVUrwDltHPodaA3SRJq+S+AzGEXdQ/o2AQ=
go.mau.fi/util v0.7.1-0.20240830150939-8c1e9c295943/go.mod h1:WuAOOV0O/otkxGkFUvfv/XE2ztegaoyM15ovS6SYbf4=
go.mau.fi/zeroconfig v0.1.3 h1:As9wYDKmktjmNZW5i1vn8zvJlmGKHeVxHVIBMXsm4kM=
go.mau.fi/zeroconfig v0.1.3/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
Expand Down
2 changes: 1 addition & 1 deletion pushrules/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (cond *PushCondition) matchValue(evt *event.Event) bool {

switch cond.Kind {
case KindEventMatch, KindRelatedEventMatch, KindUnstableRelatedEventMatch:
pattern := glob.Compile(cond.Pattern)
pattern := glob.CompileWithImplicitContains(cond.Pattern)
if pattern == nil {
return false
}
Expand Down
2 changes: 1 addition & 1 deletion pushrules/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (rule *PushRule) matchConditions(room Room, evt *event.Event) bool {
}

func (rule *PushRule) matchPattern(room Room, evt *event.Event) bool {
pattern := glob.Compile(rule.Pattern)
pattern := glob.CompileWithImplicitContains(rule.Pattern)
if pattern == nil {
return false
}
Expand Down

0 comments on commit 7a86cb2

Please sign in to comment.