Remove unmod button for moderators (#1439)

Fixes #1419
This commit is contained in:
Mm2PL 2019-12-14 13:22:49 +01:00 committed by pajlada
parent 58e909067e
commit 62cf7cbea2

View file

@ -150,8 +150,7 @@ UserInfoPopup::UserInfoPopup()
TwitchChannel *twitchChannel = TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->channel_.get()); dynamic_cast<TwitchChannel *>(this->channel_.get());
bool visibilityMod = false; bool visibilityModButtons = false;
bool visibilityUnmod = false;
if (twitchChannel) if (twitchChannel)
{ {
@ -162,12 +161,11 @@ UserInfoPopup::UserInfoPopup()
getApp()->accounts->twitch.getCurrent()->getUserName(), getApp()->accounts->twitch.getCurrent()->getUserName(),
this->userName_, Qt::CaseInsensitive) == 0; this->userName_, Qt::CaseInsensitive) == 0;
visibilityMod = twitchChannel->isBroadcaster() && !isMyself; visibilityModButtons =
visibilityUnmod = twitchChannel->isBroadcaster() && !isMyself;
visibilityMod || (twitchChannel->isMod() && isMyself);
} }
mod->setVisible(visibilityMod); mod->setVisible(visibilityModButtons);
unmod->setVisible(visibilityUnmod); unmod->setVisible(visibilityModButtons);
}); });
} }