Add input completion test suite (#4644)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Daniel Sage
2023-05-21 06:10:49 -04:00
committed by GitHub
parent e9f300b765
commit 51f2c4d1c0
24 changed files with 514 additions and 63 deletions
+7 -2
View File
@@ -188,7 +188,7 @@ void FfzEmotes::loadEmotes()
{
if (!Settings::instance().enableFFZGlobalEmotes)
{
this->global_.set(EMPTY_EMOTE_MAP);
this->setEmotes(EMPTY_EMOTE_MAP);
return;
}
@@ -199,13 +199,18 @@ void FfzEmotes::loadEmotes()
.timeout(30000)
.onSuccess([this](auto result) -> Outcome {
auto parsedSet = parseGlobalEmotes(result.parseJson());
this->global_.set(std::make_shared<EmoteMap>(std::move(parsedSet)));
this->setEmotes(std::make_shared<EmoteMap>(std::move(parsedSet)));
return Success;
})
.execute();
}
void FfzEmotes::setEmotes(std::shared_ptr<const EmoteMap> emotes)
{
this->global_.set(std::move(emotes));
}
void FfzEmotes::loadChannel(
std::weak_ptr<Channel> channel, const QString &channelID,
std::function<void(EmoteMap &&)> emoteCallback,
+1
View File
@@ -22,6 +22,7 @@ public:
std::shared_ptr<const EmoteMap> emotes() const;
boost::optional<EmotePtr> emote(const EmoteName &name) const;
void loadEmotes();
void setEmotes(std::shared_ptr<const EmoteMap> emotes);
static void loadChannel(
std::weak_ptr<Channel> channel, const QString &channelId,
std::function<void(EmoteMap &&)> emoteCallback,