Add ability to easily swap out the recent messages API with your own
Environment variable: CHATTERINO2_RECENT_MESSAGES_URL
For now, the API structure of the recent messages API is undocumented,
but once it's released it will have some documentation that
describes how to run it yourself, and it should be easy enough to
just make your own API that fits
This commit is contained in:
@@ -604,8 +604,17 @@ Outcome TwitchChannel::parseLiveStatus(const rapidjson::Document &document)
|
||||
|
||||
void TwitchChannel::loadRecentMessages()
|
||||
{
|
||||
static QString genericURL = "https://recent-messages.robotty.de/api/v2/"
|
||||
"recent-messages/%1?clearchatToNotice=true";
|
||||
static QString genericURL = [] {
|
||||
QString url("https://recent-messages.robotty.de/api/v2/recent-messages/"
|
||||
"%1?clearchatToNotice=true");
|
||||
auto envString = std::getenv("CHATTERINO2_RECENT_MESSAGES_URL");
|
||||
if (envString != nullptr)
|
||||
{
|
||||
url = envString;
|
||||
}
|
||||
|
||||
return url;
|
||||
}();
|
||||
|
||||
NetworkRequest request(genericURL.arg(this->getName()));
|
||||
request.setCaller(QThread::currentThread());
|
||||
|
||||
Reference in New Issue
Block a user