Add "Affiliate programs" to Manage Channel.

This commit is contained in:
John Preston 2024-11-29 17:07:51 +04:00
parent 86ea760011
commit fd26e1618c
2 changed files with 15 additions and 1 deletions
Telegram
Resources/langs
SourceFiles/boxes/peers

View file

@ -1545,6 +1545,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_manage_channel_title" = "Manage Channel";
"lng_manage_bot_title" = "Manage Bot";
"lng_manage_peer_recent_actions" = "Recent actions";
"lng_manage_peer_star_ref" = "Affiliate programs";
"lng_manage_peer_members" = "Members";
"lng_manage_peer_subscribers" = "Subscribers";
"lng_manage_peer_administrators" = "Administrators";

View file

@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_user.h"
#include "history/admin_log/history_admin_log_section.h"
#include "info/bot/earn/info_bot_earn_widget.h"
#include "info/bot/starref/info_bot_starref_join_widget.h"
#include "info/bot/starref/info_bot_starref_setup_widget.h"
#include "info/channel_statistics/boosts/info_boosts_widget.h"
#include "info/channel_statistics/earn/earn_format.h"
@ -1241,6 +1242,7 @@ void Controller::fillManageSection() {
&& (channel->isBroadcast() || channel->isGigagroup());
const auto hasRecentActions = isChannel
&& (channel->hasAdminRights() || channel->amCreator());
const auto hasStarRef = isChannel && channel->canPostMessages();
const auto canEditStickers = isChannel && channel->canEditStickers();
const auto canDeleteChannel = isChannel && channel->canDelete();
const auto canEditColorIndex = isChannel && channel->canEditEmoji();
@ -1423,10 +1425,21 @@ void Controller::fillManageSection() {
AddButtonWithCount(
_controls.buttonsLayout,
tr::lng_manage_peer_recent_actions(),
rpl::single(QString()), //Empty count.
rpl::single(QString()), // Empty count.
std::move(callback),
{ &st::menuIconGroupLog });
}
if (hasStarRef) {
auto callback = [=] {
_navigation->showSection(Info::BotStarRef::Join::Make(_peer));
};
AddButtonWithCount(
_controls.buttonsLayout,
tr::lng_manage_peer_star_ref(),
rpl::single(QString()), // Empty count.
std::move(callback),
{ &st::menuIconSharing });
}
if (canEditStickers || canDeleteChannel) {
::AddSkip(_controls.buttonsLayout);