Add changelog and fix condition not matching globs on body

Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
This commit is contained in:
Nicolas Werner 2022-07-04 21:33:21 +02:00
parent 9df8009ae3
commit 48fc634825
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
2 changed files with 3 additions and 1 deletions

1
changelog.d/6457.bugfix Normal file
View File

@ -0,0 +1 @@
Fix that replies to @roomba would be highlighted as a room ping. Contributed by Nico.

View File

@ -56,7 +56,8 @@ class EventMatchCondition(
// word boundary.
return try {
if (key == 'content.body') {
value.caseInsensitiveFind(pattern)
val regex = Regex("(\\W|^)"+pattern.simpleGlobToRegExp() + "(\\W|$)", setOf(RegexOption.DOT_MATCHES_ALL, RegexOption.IGNORE_CASE))
regex.containsMatchIn(value)
} else {
val regex = Regex(pattern.simpleGlobToRegExp(), setOf(RegexOption.DOT_MATCHES_ALL, RegexOption.IGNORE_CASE))
regex.matches(value)