mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Allow converting channel gifts to stars.
This commit is contained in:
parent
fa4e74ffef
commit
0d07d238bc
1 changed files with 8 additions and 1 deletions
|
@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "history/history_item_components.h" // HistoryServicePaymentRefund.
|
#include "history/history_item_components.h" // HistoryServicePaymentRefund.
|
||||||
#include "info/bot/starref/info_bot_starref_common.h"
|
#include "info/bot/starref/info_bot_starref_common.h"
|
||||||
#include "info/channel_statistics/boosts/giveaway/boost_badge.h" // InfiniteRadialAnimationWidget.
|
#include "info/channel_statistics/boosts/giveaway/boost_badge.h" // InfiniteRadialAnimationWidget.
|
||||||
|
#include "info/channel_statistics/earn/info_channel_earn_widget.h" // Info::ChannelEarn::Make.
|
||||||
#include "info/settings/info_settings_widget.h" // SectionCustomTopBarData.
|
#include "info/settings/info_settings_widget.h" // SectionCustomTopBarData.
|
||||||
#include "info/statistics/info_statistics_list_controllers.h"
|
#include "info/statistics/info_statistics_list_controllers.h"
|
||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
|
@ -240,7 +241,11 @@ void ConvertStarGift(
|
||||||
Api::InputSavedStarGiftId(savedId)
|
Api::InputSavedStarGiftId(savedId)
|
||||||
)).done([=] {
|
)).done([=] {
|
||||||
if (const auto window = show->resolveWindow()) {
|
if (const auto window = show->resolveWindow()) {
|
||||||
window->showSettings(Settings::CreditsId());
|
if (const auto channel = savedId.chat()) {
|
||||||
|
window->showSection(Info::ChannelEarn::Make(channel));
|
||||||
|
} else {
|
||||||
|
window->showSettings(Settings::CreditsId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
show->showToast(tr::lng_gift_got_stars(
|
show->showToast(tr::lng_gift_got_stars(
|
||||||
tr::now,
|
tr::now,
|
||||||
|
@ -950,6 +955,8 @@ void GenericCreditsEntryBox(
|
||||||
? item->history()->peer->asUser()
|
? item->history()->peer->asUser()
|
||||||
: (isStarGift && e.in)
|
: (isStarGift && e.in)
|
||||||
? owner->peer(PeerId(e.barePeerId))->asUser()
|
? owner->peer(PeerId(e.barePeerId))->asUser()
|
||||||
|
: (isStarGift && e.bareActorId)
|
||||||
|
? owner->peer(PeerId(e.bareActorId)).get()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
const auto convertLast = base::unixtime::serialize(e.date)
|
const auto convertLast = base::unixtime::serialize(e.date)
|
||||||
+ session->appConfig().stargiftConvertPeriodMax();
|
+ session->appConfig().stargiftConvertPeriodMax();
|
||||||
|
|
Loading…
Add table
Reference in a new issue