mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
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:
parent
8b3867fa7d
commit
de4bc02b66
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue