mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixed moderation buttons in UserInfoPopup from SearchPopup.
This commit is contained in:
parent
9472283d76
commit
8ec328f352
1 changed files with 12 additions and 9 deletions
|
@ -115,6 +115,9 @@ UserInfoPopup::UserInfoPopup()
|
||||||
TwitchChannel *twitchChannel =
|
TwitchChannel *twitchChannel =
|
||||||
dynamic_cast<TwitchChannel *>(this->channel_.get());
|
dynamic_cast<TwitchChannel *>(this->channel_.get());
|
||||||
|
|
||||||
|
bool visibilityMod = false;
|
||||||
|
bool visibilityUnmod = false;
|
||||||
|
|
||||||
if (twitchChannel)
|
if (twitchChannel)
|
||||||
{
|
{
|
||||||
qDebug() << this->userName_;
|
qDebug() << this->userName_;
|
||||||
|
@ -124,11 +127,12 @@ UserInfoPopup::UserInfoPopup()
|
||||||
getApp()->accounts->twitch.getCurrent()->getUserName(),
|
getApp()->accounts->twitch.getCurrent()->getUserName(),
|
||||||
this->userName_, Qt::CaseInsensitive) == 0;
|
this->userName_, Qt::CaseInsensitive) == 0;
|
||||||
|
|
||||||
mod->setVisible(twitchChannel->isBroadcaster() && !isMyself);
|
visibilityMod = twitchChannel->isBroadcaster() && !isMyself;
|
||||||
unmod->setVisible(
|
visibilityUnmod = visibilityMod ||
|
||||||
(twitchChannel->isBroadcaster() && !isMyself) ||
|
(twitchChannel->isMod() && isMyself);
|
||||||
(twitchChannel->isMod() && isMyself));
|
|
||||||
}
|
}
|
||||||
|
mod->setVisible(visibilityMod);
|
||||||
|
unmod->setVisible(visibilityUnmod);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,11 +147,10 @@ UserInfoPopup::UserInfoPopup()
|
||||||
TwitchChannel *twitchChannel =
|
TwitchChannel *twitchChannel =
|
||||||
dynamic_cast<TwitchChannel *>(this->channel_.get());
|
dynamic_cast<TwitchChannel *>(this->channel_.get());
|
||||||
|
|
||||||
if (twitchChannel)
|
bool hasModRights = twitchChannel ? twitchChannel->hasModRights()
|
||||||
{
|
: false;
|
||||||
lineMod->setVisible(twitchChannel->hasModRights());
|
lineMod->setVisible(hasModRights);
|
||||||
timeout->setVisible(twitchChannel->hasModRights());
|
timeout->setVisible(hasModRights);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
timeout->buttonClicked.connect([this](auto item) {
|
timeout->buttonClicked.connect([this](auto item) {
|
||||||
|
|
Loading…
Reference in a new issue