mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Added support of giveaway prize action messages to export to JSON.
This commit is contained in:
parent
bc4b427ed1
commit
678d9ffbf9
3 changed files with 16 additions and 5 deletions
|
@ -1565,10 +1565,13 @@ ServiceAction ParseServiceAction(
|
|||
content.credits = data.vstars().v;
|
||||
result.content = content;
|
||||
}, [&](const MTPDmessageActionPrizeStars &data) {
|
||||
auto content = ActionPrizeStars();
|
||||
content.peerId = ParsePeerId(data.vboost_peer());
|
||||
content.amount = data.vstars().v;
|
||||
result.content = content;
|
||||
result.content = ActionPrizeStars{
|
||||
.peerId = ParsePeerId(data.vboost_peer()),
|
||||
.amount = data.vstars().v,
|
||||
.transactionId = data.vtransaction_id().v,
|
||||
.giveawayMsgId = data.vgiveaway_msg_id().v,
|
||||
.isUnclaimed = data.is_unclaimed(),
|
||||
};
|
||||
}, [](const MTPDmessageActionEmpty &data) {});
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -611,6 +611,9 @@ struct ActionGiftStars {
|
|||
struct ActionPrizeStars {
|
||||
PeerId peerId = 0;
|
||||
uint64 amount = 0;
|
||||
Utf8String transactionId;
|
||||
int32 giveawayMsgId = 0;
|
||||
bool isUnclaimed = false;
|
||||
};
|
||||
|
||||
struct ServiceAction {
|
||||
|
|
|
@ -644,7 +644,12 @@ QByteArray SerializeMessage(
|
|||
}, [&](const ActionPrizeStars &data) {
|
||||
pushActor();
|
||||
pushAction("stars_prize");
|
||||
push("stars", data.amount); AssertIsDebug();
|
||||
push("boost_peer_id", data.peerId);
|
||||
pushBare("boost_peer_name", wrapPeerName(data.peerId));
|
||||
push("stars", data.amount);
|
||||
push("is_unclaimed", data.isUnclaimed);
|
||||
push("giveaway_msg_id", data.giveawayMsgId);
|
||||
push("transaction_id", data.transactionId);
|
||||
}, [](v::null_t) {});
|
||||
|
||||
if (v::is_null(message.action.content)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue