Fix channels not going offline properly
This commit is contained in:
@@ -181,14 +181,16 @@ void TwitchChannel::addRecentChatter(const std::shared_ptr<messages::Message> &m
|
|||||||
|
|
||||||
void TwitchChannel::setLive(bool newLiveStatus)
|
void TwitchChannel::setLive(bool newLiveStatus)
|
||||||
{
|
{
|
||||||
|
bool gotNewLiveStatus = false;
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(this->streamStatusMutex);
|
std::lock_guard<std::mutex> lock(this->streamStatusMutex);
|
||||||
if (this->streamStatus.live != newLiveStatus) {
|
if (this->streamStatus.live != newLiveStatus) {
|
||||||
|
gotNewLiveStatus = true;
|
||||||
this->streamStatus.live = newLiveStatus;
|
this->streamStatus.live = newLiveStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newLiveStatus) {
|
if (gotNewLiveStatus) {
|
||||||
this->updateLiveInfo.invoke();
|
this->updateLiveInfo.invoke();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user