mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Added entry point for channel earn info section.
This commit is contained in:
BIN
Telegram/Resources/icons/menu/earn.png
Normal file
BIN
Telegram/Resources/icons/menu/earn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 568 B |
BIN
Telegram/Resources/icons/menu/earn@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/earn@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
Telegram/Resources/icons/menu/earn@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/earn@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@@ -53,6 +53,7 @@ menuIconManage: icon {{ "menu/manage", menuIconColor }};
|
|||||||
menuIconDiscussion: icon {{ "menu/discussion", menuIconColor }};
|
menuIconDiscussion: icon {{ "menu/discussion", menuIconColor }};
|
||||||
menuIconStats: icon {{ "menu/stats", menuIconColor }};
|
menuIconStats: icon {{ "menu/stats", menuIconColor }};
|
||||||
menuIconBoosts: icon {{ "menu/boosts", menuIconColor }};
|
menuIconBoosts: icon {{ "menu/boosts", menuIconColor }};
|
||||||
|
menuIconEarn: icon {{ "menu/earn", menuIconColor }};
|
||||||
menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }};
|
menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }};
|
||||||
menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }};
|
menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }};
|
||||||
menuIconExpand: icon {{ "menu/expand", menuIconColor }};
|
menuIconExpand: icon {{ "menu/expand", menuIconColor }};
|
||||||
|
@@ -64,6 +64,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
#include "info/info_memento.h"
|
#include "info/info_memento.h"
|
||||||
#include "info/channel_statistics/boosts/info_boosts_widget.h"
|
#include "info/channel_statistics/boosts/info_boosts_widget.h"
|
||||||
|
#include "info/channel_statistics/earn/info_earn_widget.h"
|
||||||
#include "info/profile/info_profile_values.h"
|
#include "info/profile/info_profile_values.h"
|
||||||
#include "info/statistics/info_statistics_widget.h"
|
#include "info/statistics/info_statistics_widget.h"
|
||||||
#include "info/stories/info_stories_widget.h"
|
#include "info/stories/info_stories_widget.h"
|
||||||
@@ -1039,6 +1040,7 @@ void Filler::addViewStatistics() {
|
|||||||
const auto peer = _peer;
|
const auto peer = _peer;
|
||||||
using Flag = ChannelDataFlag;
|
using Flag = ChannelDataFlag;
|
||||||
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
|
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
|
||||||
|
const auto canViewEarn = (channel->flags() & Flag::CanViewRevenue);
|
||||||
if (canGetStats) {
|
if (canGetStats) {
|
||||||
_addAction(tr::lng_stats_title(tr::now), [=] {
|
_addAction(tr::lng_stats_title(tr::now), [=] {
|
||||||
if (const auto strong = weak.get()) {
|
if (const auto strong = weak.get()) {
|
||||||
@@ -1062,6 +1064,13 @@ void Filler::addViewStatistics() {
|
|||||||
}
|
}
|
||||||
}, &st::menuIconBoosts);
|
}, &st::menuIconBoosts);
|
||||||
}
|
}
|
||||||
|
if (canViewEarn) {
|
||||||
|
_addAction(tr::lng_channel_earn_title(tr::now), [=] {
|
||||||
|
if (const auto strong = weak.get()) {
|
||||||
|
controller->showSection(Info::ChannelEarn::Make(peer));
|
||||||
|
}
|
||||||
|
}, &st::menuIconEarn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user