mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Record bareMsgId in CreditsHistoryEntry.
This commit is contained in:
parent
968d036834
commit
5fdaa6b91f
6 changed files with 12 additions and 9 deletions
|
@ -43,7 +43,8 @@ constexpr auto kTransactionsLimit = 100;
|
||||||
.date = base::unixtime::parse(tl.data().vdate().v),
|
.date = base::unixtime::parse(tl.data().vdate().v),
|
||||||
.photoId = photo ? photo->id : 0,
|
.photoId = photo ? photo->id : 0,
|
||||||
.credits = tl.data().vstars().v,
|
.credits = tl.data().vstars().v,
|
||||||
.bareId = barePeerId,
|
.bareMsgId = uint64(tl.data().vmsg_id().value_or_empty()),
|
||||||
|
.barePeerId = barePeerId,
|
||||||
.peerType = tl.data().vpeer().match([](const HistoryPeerTL &) {
|
.peerType = tl.data().vpeer().match([](const HistoryPeerTL &) {
|
||||||
return Data::CreditsHistoryEntry::PeerType::Peer;
|
return Data::CreditsHistoryEntry::PeerType::Peer;
|
||||||
}, [](const MTPDstarsTransactionPeerPlayMarket &) {
|
}, [](const MTPDstarsTransactionPeerPlayMarket &) {
|
||||||
|
|
|
@ -1646,12 +1646,12 @@ void AddCreditsHistoryEntryTable(
|
||||||
container,
|
container,
|
||||||
st::giveawayGiftCodeTable),
|
st::giveawayGiftCodeTable),
|
||||||
st::giveawayGiftCodeTableMargin);
|
st::giveawayGiftCodeTableMargin);
|
||||||
if (entry.bareId) {
|
if (entry.barePeerId) {
|
||||||
AddTableRow(
|
AddTableRow(
|
||||||
table,
|
table,
|
||||||
tr::lng_credits_box_history_entry_peer(),
|
tr::lng_credits_box_history_entry_peer(),
|
||||||
controller,
|
controller,
|
||||||
PeerId(entry.bareId));
|
PeerId(entry.barePeerId));
|
||||||
}
|
}
|
||||||
using Type = Data::CreditsHistoryEntry::PeerType;
|
using Type = Data::CreditsHistoryEntry::PeerType;
|
||||||
if (entry.peerType == Type::AppStore) {
|
if (entry.peerType == Type::AppStore) {
|
||||||
|
|
|
@ -35,7 +35,8 @@ struct CreditsHistoryEntry final {
|
||||||
QDateTime date;
|
QDateTime date;
|
||||||
PhotoId photoId = 0;
|
PhotoId photoId = 0;
|
||||||
uint64 credits = 0;
|
uint64 credits = 0;
|
||||||
uint64 bareId = 0;
|
uint64 bareMsgId = 0;
|
||||||
|
uint64 barePeerId = 0;
|
||||||
PeerType peerType;
|
PeerType peerType;
|
||||||
bool refunded = false;
|
bool refunded = false;
|
||||||
bool pending = false;
|
bool pending = false;
|
||||||
|
|
|
@ -938,8 +938,8 @@ void CreditsController::applySlice(const Data::CreditsStatusSlice &slice) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
using Type = Data::CreditsHistoryEntry::PeerType;
|
using Type = Data::CreditsHistoryEntry::PeerType;
|
||||||
if (item.bareId) {
|
if (const auto peerId = PeerId(item.barePeerId)) {
|
||||||
const auto peer = session().data().peer(PeerId(item.bareId));
|
const auto peer = session().data().peer(peerId);
|
||||||
return std::make_unique<CreditsRow>(peer, descriptor);
|
return std::make_unique<CreditsRow>(peer, descriptor);
|
||||||
} else if (item.peerType == Type::PremiumBot) {
|
} else if (item.peerType == Type::PremiumBot) {
|
||||||
return std::make_unique<CreditsRow>(_premiumBot, descriptor);
|
return std::make_unique<CreditsRow>(_premiumBot, descriptor);
|
||||||
|
|
|
@ -105,7 +105,8 @@ Fn<void(NonPanelPaymentForm)> ProcessNonPanelPaymentFormFactory(
|
||||||
.date = base::unixtime::parse(receipt->date),
|
.date = base::unixtime::parse(receipt->date),
|
||||||
.photoId = receipt->photo ? receipt->photo->id : 0,
|
.photoId = receipt->photo ? receipt->photo->id : 0,
|
||||||
.credits = receipt->credits,
|
.credits = receipt->credits,
|
||||||
.bareId = receipt->peerId.value,
|
.bareMsgId = uint64(),
|
||||||
|
.barePeerId = receipt->peerId.value,
|
||||||
.peerType = Data::CreditsHistoryEntry::PeerType::Peer,
|
.peerType = Data::CreditsHistoryEntry::PeerType::Peer,
|
||||||
};
|
};
|
||||||
controller->uiShow()->show(Box(
|
controller->uiShow()->show(Box(
|
||||||
|
|
|
@ -336,8 +336,8 @@ void ReceiptCreditsBox(
|
||||||
const auto &stUser = st::boostReplaceUserpic;
|
const auto &stUser = st::boostReplaceUserpic;
|
||||||
const auto peer = (e.peerType == Type::PremiumBot)
|
const auto peer = (e.peerType == Type::PremiumBot)
|
||||||
? premiumBot
|
? premiumBot
|
||||||
: e.bareId
|
: e.barePeerId
|
||||||
? controller->session().data().peer(PeerId(e.bareId)).get()
|
? controller->session().data().peer(PeerId(e.barePeerId)).get()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
const auto photo = e.photoId
|
const auto photo = e.photoId
|
||||||
? controller->session().data().photo(e.photoId).get()
|
? controller->session().data().photo(e.photoId).get()
|
||||||
|
|
Loading…
Add table
Reference in a new issue