mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed issue where when a channel was going offline it would do a toast if the channel was notified
This commit is contained in:
parent
6b3ee6b09c
commit
01ca055763
|
@ -45,10 +45,8 @@ void NotificationController::initialize(Settings &settings, Paths &paths)
|
||||||
|
|
||||||
this->fetchFakeChannels();
|
this->fetchFakeChannels();
|
||||||
|
|
||||||
QObject::connect(this->liveStatusTimer_, &QTimer::timeout, [=] {
|
QObject::connect(this->liveStatusTimer_, &QTimer::timeout,
|
||||||
this->fetchFakeChannels();
|
[=] { this->fetchFakeChannels(); });
|
||||||
qDebug() << " MY CODE IS SHIT OMEGALUL ";
|
|
||||||
});
|
|
||||||
this->liveStatusTimer_->start(60 * 1000);
|
this->liveStatusTimer_->start(60 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +118,6 @@ NotificationModel *NotificationController::createModel(QObject *parent,
|
||||||
|
|
||||||
void NotificationController::fetchFakeChannels()
|
void NotificationController::fetchFakeChannels()
|
||||||
{
|
{
|
||||||
qDebug() << " USING DEBUGGER ";
|
|
||||||
for (std::vector<int>::size_type i = 0;
|
for (std::vector<int>::size_type i = 0;
|
||||||
i != channelMap[Platform::Twitch].getVector().size(); i++) {
|
i != channelMap[Platform::Twitch].getVector().size(); i++) {
|
||||||
auto chan = getApp()->twitch.server->getChannelOrEmpty(
|
auto chan = getApp()->twitch.server->getChannelOrEmpty(
|
||||||
|
|
|
@ -395,23 +395,30 @@ void TwitchChannel::setLive(bool newLiveStatus)
|
||||||
auto guard = this->streamStatus_.access();
|
auto guard = this->streamStatus_.access();
|
||||||
if (guard->live != newLiveStatus) {
|
if (guard->live != newLiveStatus) {
|
||||||
gotNewLiveStatus = true;
|
gotNewLiveStatus = true;
|
||||||
if (getApp()->notifications->isChannelNotified(this->getName(),
|
if (newLiveStatus) {
|
||||||
Platform::Twitch)) {
|
if (getApp()->notifications->isChannelNotified(
|
||||||
if (Toasts::isEnabled()) {
|
this->getName(), Platform::Twitch)) {
|
||||||
getApp()->toasts->sendChannelNotification(this->getName(),
|
if (Toasts::isEnabled()) {
|
||||||
Platform::Twitch);
|
getApp()->toasts->sendChannelNotification(
|
||||||
}
|
this->getName(), Platform::Twitch);
|
||||||
if (getSettings()->notificationPlaySound) {
|
}
|
||||||
getApp()->notifications->playSound();
|
if (getSettings()->notificationPlaySound) {
|
||||||
}
|
getApp()->notifications->playSound();
|
||||||
if (getSettings()->notificationFlashTaskbar) {
|
}
|
||||||
QApplication::alert(
|
if (getSettings()->notificationFlashTaskbar) {
|
||||||
getApp()->windows->getMainWindow().window(), 2500);
|
QApplication::alert(
|
||||||
|
getApp()->windows->getMainWindow().window(), 2500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
auto live = makeSystemMessage(this->getName() + " is live");
|
||||||
|
this->addMessage(live);
|
||||||
|
this->tabHighlightRequested.invoke(
|
||||||
|
HighlightState::Notification);
|
||||||
|
} else {
|
||||||
|
auto offline =
|
||||||
|
makeSystemMessage(this->getName() + " is offline");
|
||||||
|
this->addMessage(offline);
|
||||||
}
|
}
|
||||||
auto live = makeSystemMessage(this->getName() + " is live");
|
|
||||||
this->addMessage(live);
|
|
||||||
this->tabHighlightRequested.invoke(HighlightState::Notification);
|
|
||||||
guard->live = newLiveStatus;
|
guard->live = newLiveStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue