feat: add snapshot tests for eventsub messages (#5965)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "providers/seventv/SeventvEmotes.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "util/Twitch.hpp"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -45,8 +46,19 @@ public:
|
||||
|
||||
ChannelPtr getChannelOrEmpty(const QString &dirtyChannelName) override
|
||||
{
|
||||
assert(false && "unimplemented getChannelOrEmpty in mock irc server");
|
||||
return {};
|
||||
QString query = cleanChannelName(dirtyChannelName);
|
||||
|
||||
auto it = this->mockChannels.find(query);
|
||||
if (it == this->mockChannels.end())
|
||||
{
|
||||
return Channel::getEmpty();
|
||||
}
|
||||
auto chan = it->second.lock();
|
||||
if (!chan)
|
||||
{
|
||||
return Channel::getEmpty();
|
||||
}
|
||||
return chan;
|
||||
}
|
||||
|
||||
void addFakeMessage(const QString &data) override
|
||||
|
||||
Reference in New Issue
Block a user