fix for bur0k

This commit is contained in:
fourtf 2018-01-17 17:17:26 +01:00
parent b3951262c8
commit 7310f1b888
4 changed files with 29 additions and 2 deletions

View file

@ -83,6 +83,22 @@ void TwitchChannel::sendMessage(const QString &message)
singletons::IrcManager::getInstance().sendMessage(this->name, parsedMessage);
}
bool TwitchChannel::isMod()
{
return this->mod;
}
bool TwitchChannel::isBroadcaster()
{
return this->name == singletons::AccountManager::getInstance().Twitch.getCurrent()->getUserId();
}
bool TwitchChannel::hasModRights()
{
// fourtf: check if staff
return this->isMod() || this->isBroadcaster();
}
void TwitchChannel::setLive(bool newLiveStatus)
{
if (this->isLive == newLiveStatus) {

View file

@ -22,6 +22,10 @@ public:
bool canSendMessage() const override;
void sendMessage(const QString &message) override;
bool isMod();
bool isBroadcaster();
bool hasModRights();
const std::shared_ptr<chatterino::util::EmoteMap> bttvChannelEmotes;
const std::shared_ptr<chatterino::util::EmoteMap> ffzChannelEmotes;
@ -34,6 +38,7 @@ public:
boost::signals2::signal<void()> onlineStatusChanged;
pajlada::Signals::NoArgBoltSignal fetchMessages;
pajlada::Signals::NoArgSignal userStateChanged;
QString roomID;
bool isLive;
@ -47,6 +52,8 @@ private:
void refreshLiveStatus();
void fetchRecentMessages();
bool mod;
};
} // namespace twitch

View file

@ -120,9 +120,11 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
return;
}
if (this->highlightState != HighlightState::Highlighted) {
this->highlightState = newHighlightStyle;
this->update();
}
}
QRect NotebookTab::getDesiredRect() const

View file

@ -160,6 +160,8 @@ void SplitHeader::updateModerationModeIcon()
this->moderationButton->setPixmap(this->split->getModerationMode()
? resourceManager.moderationmode_enabled->getPixmap()
: resourceManager.moderationmode_disabled->getPixmap());
this->moderationButton->setVisible(this->split->channel->hasModRights());
}
void SplitHeader::paintEvent(QPaintEvent *)