Merge branch '4tf'

This commit is contained in:
fourtf
2018-08-06 18:41:30 +02:00
197 changed files with 3807 additions and 2801 deletions
+12 -11
View File
@@ -34,8 +34,9 @@ void LogsPopup::setInfo(ChannelPtr channel, QString userName)
{
this->channel_ = channel;
this->userName_ = userName;
this->setWindowTitle(this->userName_ + "'s logs in #" + this->channel_->name);
this->getRoomID();
this->setWindowTitle(this->userName_ + "'s logs in #" + this->channel_->getName());
this->getLogviewerLogs();
}
void LogsPopup::setMessages(std::vector<MessagePtr> &messages)
@@ -53,7 +54,7 @@ void LogsPopup::getRoomID()
return;
}
QString channelName = twitchChannel->name;
QString channelName = twitchChannel->getName();
QString url = QString("https://cbenni.com/api/channel/%1").arg(channelName);
@@ -65,11 +66,11 @@ void LogsPopup::getRoomID()
return true;
});
req.onSuccess([this, channelName](auto result) {
req.onSuccess([this, channelName](auto result) -> Outcome {
auto data = result.parseJson();
this->roomID_ = data.value("channel")["id"].toInt();
this->roomID_ = data.value("channel").toObject()["id"].toInt();
this->getLogviewerLogs();
return true;
return Success;
});
req.execute();
@@ -82,7 +83,7 @@ void LogsPopup::getLogviewerLogs()
return;
}
QString channelName = twitchChannel->name;
QString channelName = twitchChannel->getName();
auto url = QString("https://cbenni.com/api/logs/%1/?nick=%2&before=500")
.arg(channelName, this->userName_);
@@ -95,7 +96,7 @@ void LogsPopup::getLogviewerLogs()
return true;
});
req.onSuccess([this, channelName](auto result) {
req.onSuccess([this, channelName](auto result) -> Outcome {
auto data = result.parseJson();
std::vector<MessagePtr> messages;
@@ -118,7 +119,7 @@ void LogsPopup::getLogviewerLogs()
};
this->setMessages(messages);
return true;
return Success;
});
req.execute();
@@ -131,7 +132,7 @@ void LogsPopup::getOverrustleLogs()
return;
}
QString channelName = twitchChannel->name;
QString channelName = twitchChannel->getName();
QString url = QString("https://overrustlelogs.net/api/v1/stalk/%1/%2.json?limit=500")
.arg(channelName, this->userName_);
@@ -149,7 +150,7 @@ void LogsPopup::getOverrustleLogs()
return true;
});
req.onSuccess([this, channelName](auto result) {
req.onSuccess([this, channelName](auto result) -> Outcome {
auto data = result.parseJson();
std::vector<MessagePtr> messages;
if (data.contains("lines")) {
@@ -170,7 +171,7 @@ void LogsPopup::getOverrustleLogs()
}
this->setMessages(messages);
return true;
return Success;
});
req.execute();