diff --git a/chatterino.pro b/chatterino.pro index ed8682ba0..ea1277208 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -231,7 +231,6 @@ SOURCES += \ src/singletons/Updates.cpp \ src/singletons/Theme.cpp \ src/controllers/moderationactions/ModerationActionModel.cpp \ - src/widgets/settingspages/NotificationPage.cpp \ src/widgets/settingspages/LookPage.cpp \ src/widgets/settingspages/FeelPage.cpp \ src/util/InitUpdateButton.cpp \ @@ -255,8 +254,6 @@ SOURCES += \ src/BrowserExtension.cpp \ src/util/FormatTime.cpp \ src/util/FunctionEventFilter.cpp \ - src/controllers/notifications/notificationcontroller.cpp \ - src/widgets/settingspages/NotificationPage.cpp \ src/controllers/notifications/NotificationModel.cpp \ src/singletons/Toasts.cpp @@ -433,7 +430,6 @@ HEADERS += \ src/widgets/dialogs/LogsPopup.hpp \ src/common/Singleton.hpp \ src/controllers/moderationactions/ModerationActionModel.hpp \ - src/widgets/settingspages/NotificationPage.hpp \ src/widgets/settingspages/LookPage.hpp \ src/widgets/settingspages/FeelPage.hpp \ src/util/InitUpdateButton.hpp \ @@ -460,7 +456,6 @@ HEADERS += \ src/BrowserExtension.hpp \ src/util/FormatTime.hpp \ src/util/FunctionEventFilter.hpp \ - src/widgets/settingspages/NotificationPage.hpp \ src/controllers/notifications/NotificationModel.hpp \ src/controllers/notifications/NotificationPhrase.hpp \ src/singletons/Toasts.hpp diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index 1b1bd2b1c..92272f978 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -23,7 +23,7 @@ void NotificationController::initialize(Settings &settings, Paths &paths) this->twitchSetting_.setValue( this->channelMap[Platform::Twitch].getVector()); }); - + /* for (const QString &channelName : this->mixerSetting_.getValue()) { this->channelMap[Platform::Mixer].appendItem(channelName); } @@ -32,6 +32,7 @@ void NotificationController::initialize(Settings &settings, Paths &paths) this->mixerSetting_.setValue( this->channelMap[Platform::Mixer].getVector()); }); + */ } void NotificationController::updateChannelNotification( @@ -52,24 +53,6 @@ bool NotificationController::isChannelNotified(const QString &channelName, return true; } } - // for (std::vector::size_type i = 0; i != channelMap[p]) - /* - if (p == Platform::Twitch) { - for (std::vector::size_type i = 0; - i != twitchVector.getVector().size(); i++) { - if (twitchVector.getVector()[i].toLower() == - channelName.toLowercase()) { return true; - } - } - } else if (p == Platform::Mixer) { - for (std::vector::size_type i = 0; - i != mixerVector.getVector().size(); i++) { - if (mixerVector.getVector()[i].toLower() == - channelName.toLowercase()) { return true; - } - } - } - */ return false; } @@ -84,7 +67,7 @@ void NotificationController::removeChannelNotification( { for (std::vector::size_type i = 0; i != channelMap[p].getVector().size(); i++) { - if (channelMap[p].getVector()[i].toLower() == channelName) { + if (channelMap[p].getVector()[i].toLower() == channelName.toLower()) { channelMap[p].removeItem(i); i--; } @@ -116,13 +99,6 @@ NotificationModel *NotificationController::createModel(QObject *parent, { NotificationModel *model = new NotificationModel(parent); model->init(&this->channelMap[p]); - /* - if (p == Platform::Twitch) { - model->init(&this->twitchVector); - } else if (p == Platform::Mixer) { - model->init(&this->mixerVector); - } - */ return model; } diff --git a/src/controllers/notifications/NotificationController.hpp b/src/controllers/notifications/NotificationController.hpp index c3bfad38f..da5bcd03a 100644 --- a/src/controllers/notifications/NotificationController.hpp +++ b/src/controllers/notifications/NotificationController.hpp @@ -11,9 +11,8 @@ class Paths; class NotificationModel; enum class Platform : uint8_t { - Twitch = 0, // 0 - Mixer = 1, // 1 - HitBox = 2, // 2 + Twitch, // 0 + // Mixer, // 1 }; class NotificationController final : public Singleton @@ -31,8 +30,6 @@ public: UnsortedSignalVector getVector(Platform p); std::map> channelMap; - // UnsortedSignalVector twitchVector; - // UnsortedSignalVector mixerVector; NotificationModel *createModel(QObject *parent, Platform p); @@ -40,8 +37,10 @@ private: bool initialized_ = false; ChatterinoSetting> twitchSetting_ = { "/notifications/twitch"}; + /* ChatterinoSetting> mixerSetting_ = { "/notifications/mixer"}; + */ }; } // namespace chatterino diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 39c451ec4..864fba437 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -352,8 +352,7 @@ void TwitchChannel::refreshLiveStatus() QString url("https://api.twitch.tv/kraken/streams/" + roomID); //<<<<<<< HEAD - // auto request = makeGetStreamRequest(roomID, - // QThread::currentThread()); + // auto request = makeGetStreamRequest(roomID, QThread::currentThread()); //======= auto request = NetworkRequest::twitchRequest(url); request.setCaller(QThread::currentThread()); @@ -400,8 +399,7 @@ Outcome TwitchChannel::parseLiveStatus(const rapidjson::Document &document) const rapidjson::Value &streamChannel = stream["channel"]; if (!streamChannel.IsObject() || !streamChannel.HasMember("status")) { - Log("[TwitchChannel:refreshLiveStatus] Missing member \"status\" " - "in " + Log("[TwitchChannel:refreshLiveStatus] Missing member \"status\" in " "channel"); return Failure; } @@ -475,8 +473,8 @@ Outcome TwitchChannel::parseRecentMessages(const QJsonObject &jsonRoot) for (const auto jsonMessage : jsonMessages) { auto content = jsonMessage.toString().toUtf8(); - // passing nullptr as the channel makes the message invalid but we - // don't check for that anyways + // passing nullptr as the channel makes the message invalid but we don't + // check for that anyways auto message = Communi::IrcMessage::fromData(content, nullptr); auto privMsg = dynamic_cast(message); assert(privMsg); diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index 000b1bbec..bc084d73f 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -118,8 +118,6 @@ private: void loadRecentMessages(); Outcome parseRecentMessages(const QJsonObject &jsonRoot); - bool toastIsEnabled(); - void setLive(bool newLiveStatus); void loadBadges(); @@ -155,8 +153,6 @@ private: QTimer liveStatusTimer_; QTimer chattersListTimer_; - std::vector liveChannels; - friend class TwitchServer; }; diff --git a/src/widgets/settingspages/NotificationPage.cpp b/src/widgets/settingspages/NotificationPage.cpp index 6a0b9e55e..6dd756b80 100644 --- a/src/widgets/settingspages/NotificationPage.cpp +++ b/src/widgets/settingspages/NotificationPage.cpp @@ -68,6 +68,7 @@ NotificationPage::NotificationPage() .appendItem("channel"); }); } + /* auto mixerChannels = tabs.appendTab(new QVBoxLayout, "Mixer"); { EditableModelView *view = @@ -94,6 +95,7 @@ NotificationPage::NotificationPage() .appendItem("channel"); }); } + */ } } }