Respect appconfig starref restrictions.

This commit is contained in:
John Preston
2024-11-29 17:35:46 +04:00
parent 89058c63c8
commit a97880132a
10 changed files with 56 additions and 12 deletions
@@ -1242,7 +1242,9 @@ void Controller::fillManageSection() {
&& (channel->isBroadcast() || channel->isGigagroup());
const auto hasRecentActions = isChannel
&& (channel->hasAdminRights() || channel->amCreator());
const auto hasStarRef = isChannel && channel->canPostMessages();
const auto hasStarRef = Info::BotStarRef::Join::Allowed(_peer)
&& isChannel
&& channel->canPostMessages();
const auto canEditStickers = isChannel && channel->canEditStickers();
const auto canDeleteChannel = isChannel && channel->canDelete();
const auto canEditColorIndex = isChannel && channel->canEditEmoji();
@@ -1730,6 +1732,10 @@ void Controller::fillBotCreditsButton() {
void Controller::fillBotAffiliateProgram() {
Expects(_isBot);
if (!Info::BotStarRef::Setup::Allowed(_peer)) {
return;
}
const auto user = _peer->asUser();
auto label = user->session().changes().peerFlagsValue(
user,