fix: allow messages of just dots (#6330)

This commit is contained in:
nerix
2025-07-12 22:30:54 +02:00
committed by GitHub
parent 0d205a63f0
commit 76b9432da7
3 changed files with 34 additions and 2 deletions
+1 -1
View File
@@ -45,7 +45,7 @@
- Bugfix: Fixed inconsistent spaces in messages when using fractional scaling. (#6231, #6254) - Bugfix: Fixed inconsistent spaces in messages when using fractional scaling. (#6231, #6254)
- Bugfix: Fixed eventsub message delete notifications not being affected by "Show deletions of single messages". (#6233) - Bugfix: Fixed eventsub message delete notifications not being affected by "Show deletions of single messages". (#6233)
- Bugfix: Don't add reply buttons to messages that are invalid reply targets. (#6119) - Bugfix: Don't add reply buttons to messages that are invalid reply targets. (#6119)
- Bugfix: Fixed invalid commands from being forwarded to Helix, making it possible for information to leak (e.g. if you typed `/bann username ban reason` it would be seen by others in chat as `username ban reason`). (#6272) - Bugfix: Fixed invalid commands from being forwarded to Helix, making it possible for information to leak (e.g. if you typed `/bann username ban reason` it would be seen by others in chat as `username ban reason`). (#6272, #6330)
- Dev: Mini refactor of Split. (#6148) - Dev: Mini refactor of Split. (#6148)
- Dev: Conan will no longer generate a `CMakeUserPresets.json` file. (#6117) - Dev: Conan will no longer generate a `CMakeUserPresets.json` file. (#6117)
- Dev: Pass `--force-openssl` when installing from CMake in Qt 6.8+. (#6129) - Dev: Pass `--force-openssl` when installing from CMake in Qt 6.8+. (#6129)
+2 -1
View File
@@ -66,7 +66,8 @@ namespace detail {
bool isUnknownCommand(const QString &text) bool isUnknownCommand(const QString &text)
{ {
static QRegularExpression isUnknownCommand( static QRegularExpression isUnknownCommand(
R"(^(?:\.|\/)(?!me\s|\s))", QRegularExpression::CaseInsensitiveOption); R"(^(?:\.(?!\.|$)|\/)(?!me(?:\s|$)|\s))",
QRegularExpression::CaseInsensitiveOption);
auto match = isUnknownCommand.match(text); auto match = isUnknownCommand.match(text);
+31
View File
@@ -20,6 +20,27 @@ TEST(TwitchChannelDetail_isUnknownCommand, good)
". .hello", ". .hello",
"/ .hello", "/ .hello",
". /hello", ". /hello",
".", // this results in an empty message but not in an error (twitchdev/issues#1019)
"/me",
".me",
"..",
"...",
"....",
"",
"foo",
"a",
"!",
". .",
". ..",
".. ..",
".. .",
"/ /",
"/ .",
". /",
". ./",
".. /",
".. me",
". me",
}; };
// clang-format on // clang-format on
@@ -40,6 +61,16 @@ TEST(TwitchChannelDetail_isUnknownCommand, bad)
".badcommand hello", ".badcommand hello",
"/@badcommand hello", "/@badcommand hello",
".@badcommand hello", ".@badcommand hello",
"/bann username ban reason",
"/bann username",
"//",
"./",
"./me",
"./w",
"/.",
"/.me",
"/.w",
"/,me",
}; };
// clang-format on // clang-format on