From 1e7d3a2ec61f73e036229ba8479cbfba8bda5ef9 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Thu, 18 Jan 2018 18:17:48 +0100 Subject: [PATCH] Make isMod a virtual method so it can be called from the base class too --- src/channel.hpp | 4 ++++ src/twitch/twitchchannel.cpp | 2 +- src/twitch/twitchchannel.hpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/channel.hpp b/src/channel.hpp index 51aa307c..ac06a2a0 100644 --- a/src/channel.hpp +++ b/src/channel.hpp @@ -53,6 +53,10 @@ public: virtual bool canSendMessage() const; virtual void sendMessage(const QString &message); + virtual bool isMod() const + { + return false; + } private: messages::LimitedQueue messages; diff --git a/src/twitch/twitchchannel.cpp b/src/twitch/twitchchannel.cpp index b5e36ac5..03897859 100644 --- a/src/twitch/twitchchannel.cpp +++ b/src/twitch/twitchchannel.cpp @@ -90,7 +90,7 @@ void TwitchChannel::sendMessage(const QString &message) singletons::IrcManager::getInstance().sendMessage(this->name, parsedMessage); } -bool TwitchChannel::isMod() +bool TwitchChannel::isMod() const { return this->mod; } diff --git a/src/twitch/twitchchannel.hpp b/src/twitch/twitchchannel.hpp index 0aae27b3..2c5f4905 100644 --- a/src/twitch/twitchchannel.hpp +++ b/src/twitch/twitchchannel.hpp @@ -22,7 +22,7 @@ public: bool canSendMessage() const override; void sendMessage(const QString &message) override; - bool isMod(); + bool isMod() const override; void setMod(bool value); bool isBroadcaster(); bool hasModRights();