Refactor recent messages API (#4763)

This exposes internal functions for testing by splitting the implementation & internal API into separate files
This commit is contained in:
pajlada
2023-08-12 13:34:59 +02:00
committed by GitHub
parent 5ee9697dd2
commit 3e1e400e3e
9 changed files with 332 additions and 278 deletions
+3 -3
View File
@@ -18,7 +18,7 @@
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/bttv/BttvLiveUpdates.hpp"
#include "providers/bttv/liveupdates/BttvLiveUpdateMessages.hpp"
#include "providers/RecentMessagesApi.hpp"
#include "providers/recentmessages/Api.hpp"
#include "providers/seventv/eventapi/Dispatch.hpp"
#include "providers/seventv/SeventvAPI.hpp"
#include "providers/seventv/SeventvEmotes.hpp"
@@ -1108,7 +1108,7 @@ void TwitchChannel::loadRecentMessages()
}
auto weak = weakOf<Channel>(this);
RecentMessagesApi::loadRecentMessages(
recentmessages::load(
this->getName(), weak,
[weak](const auto &messages) {
auto shared = weak.lock();
@@ -1163,7 +1163,7 @@ void TwitchChannel::loadRecentMessagesReconnect()
}
auto weak = weakOf<Channel>(this);
RecentMessagesApi::loadRecentMessages(
recentmessages::load(
this->getName(), weak,
[weak](const auto &messages) {
auto shared = weak.lock();