mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +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),
|
||||
.photoId = photo ? photo->id : 0,
|
||||
.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 &) {
|
||||
return Data::CreditsHistoryEntry::PeerType::Peer;
|
||||
}, [](const MTPDstarsTransactionPeerPlayMarket &) {
|
||||
|
|
|
@ -1646,12 +1646,12 @@ void AddCreditsHistoryEntryTable(
|
|||
container,
|
||||
st::giveawayGiftCodeTable),
|
||||
st::giveawayGiftCodeTableMargin);
|
||||
if (entry.bareId) {
|
||||
if (entry.barePeerId) {
|
||||
AddTableRow(
|
||||
table,
|
||||
tr::lng_credits_box_history_entry_peer(),
|
||||
controller,
|
||||
PeerId(entry.bareId));
|
||||
PeerId(entry.barePeerId));
|
||||
}
|
||||
using Type = Data::CreditsHistoryEntry::PeerType;
|
||||
if (entry.peerType == Type::AppStore) {
|
||||
|
|
|
@ -35,7 +35,8 @@ struct CreditsHistoryEntry final {
|
|||
QDateTime date;
|
||||
PhotoId photoId = 0;
|
||||
uint64 credits = 0;
|
||||
uint64 bareId = 0;
|
||||
uint64 bareMsgId = 0;
|
||||
uint64 barePeerId = 0;
|
||||
PeerType peerType;
|
||||
bool refunded = false;
|
||||
bool pending = false;
|
||||
|
|
|
@ -938,8 +938,8 @@ void CreditsController::applySlice(const Data::CreditsStatusSlice &slice) {
|
|||
},
|
||||
};
|
||||
using Type = Data::CreditsHistoryEntry::PeerType;
|
||||
if (item.bareId) {
|
||||
const auto peer = session().data().peer(PeerId(item.bareId));
|
||||
if (const auto peerId = PeerId(item.barePeerId)) {
|
||||
const auto peer = session().data().peer(peerId);
|
||||
return std::make_unique<CreditsRow>(peer, descriptor);
|
||||
} else if (item.peerType == Type::PremiumBot) {
|
||||
return std::make_unique<CreditsRow>(_premiumBot, descriptor);
|
||||
|
|
|
@ -105,7 +105,8 @@ Fn<void(NonPanelPaymentForm)> ProcessNonPanelPaymentFormFactory(
|
|||
.date = base::unixtime::parse(receipt->date),
|
||||
.photoId = receipt->photo ? receipt->photo->id : 0,
|
||||
.credits = receipt->credits,
|
||||
.bareId = receipt->peerId.value,
|
||||
.bareMsgId = uint64(),
|
||||
.barePeerId = receipt->peerId.value,
|
||||
.peerType = Data::CreditsHistoryEntry::PeerType::Peer,
|
||||
};
|
||||
controller->uiShow()->show(Box(
|
||||
|
|
|
@ -336,8 +336,8 @@ void ReceiptCreditsBox(
|
|||
const auto &stUser = st::boostReplaceUserpic;
|
||||
const auto peer = (e.peerType == Type::PremiumBot)
|
||||
? premiumBot
|
||||
: e.bareId
|
||||
? controller->session().data().peer(PeerId(e.bareId)).get()
|
||||
: e.barePeerId
|
||||
? controller->session().data().peer(PeerId(e.barePeerId)).get()
|
||||
: nullptr;
|
||||
const auto photo = e.photoId
|
||||
? controller->session().data().photo(e.photoId).get()
|
||||
|
|
Loading…
Add table
Reference in a new issue