feat: add snapshot tests for eventsub messages (#5965)

This commit is contained in:
nerix
2025-02-21 21:33:29 +01:00
committed by GitHub
parent bb4c6d6f6e
commit a86df7087d
17 changed files with 885 additions and 21 deletions
+10
View File
@@ -62,6 +62,16 @@ void stripChannelName(QString &channelName)
}
}
QString cleanChannelName(const QString &dirtyChannelName)
{
if (dirtyChannelName.startsWith('#'))
{
return dirtyChannelName.mid(1).toLower();
}
return dirtyChannelName.toLower();
}
std::pair<ParsedUserName, ParsedUserID> parseUserNameOrID(const QString &input)
{
if (input.startsWith("id:"))
+3
View File
@@ -16,6 +16,9 @@ void stripUserName(QString &userName);
// stripChannelName removes any @ prefix or , suffix to make it more suitable for command use
void stripChannelName(QString &channelName);
/// Strips a leading `#` and lowercases the name
QString cleanChannelName(const QString &dirtyChannelName);
using ParsedUserName = QString;
using ParsedUserID = QString;