mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
content.credits = data.vstars().v;
|
||||||
result.content = content;
|
result.content = content;
|
||||||
}, [&](const MTPDmessageActionPrizeStars &data) {
|
}, [&](const MTPDmessageActionPrizeStars &data) {
|
||||||
auto content = ActionPrizeStars();
|
result.content = ActionPrizeStars{
|
||||||
content.peerId = ParsePeerId(data.vboost_peer());
|
.peerId = ParsePeerId(data.vboost_peer()),
|
||||||
content.amount = data.vstars().v;
|
.amount = data.vstars().v,
|
||||||
result.content = content;
|
.transactionId = data.vtransaction_id().v,
|
||||||
|
.giveawayMsgId = data.vgiveaway_msg_id().v,
|
||||||
|
.isUnclaimed = data.is_unclaimed(),
|
||||||
|
};
|
||||||
}, [](const MTPDmessageActionEmpty &data) {});
|
}, [](const MTPDmessageActionEmpty &data) {});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -611,6 +611,9 @@ struct ActionGiftStars {
|
||||||
struct ActionPrizeStars {
|
struct ActionPrizeStars {
|
||||||
PeerId peerId = 0;
|
PeerId peerId = 0;
|
||||||
uint64 amount = 0;
|
uint64 amount = 0;
|
||||||
|
Utf8String transactionId;
|
||||||
|
int32 giveawayMsgId = 0;
|
||||||
|
bool isUnclaimed = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServiceAction {
|
struct ServiceAction {
|
||||||
|
|
|
@ -644,7 +644,12 @@ QByteArray SerializeMessage(
|
||||||
}, [&](const ActionPrizeStars &data) {
|
}, [&](const ActionPrizeStars &data) {
|
||||||
pushActor();
|
pushActor();
|
||||||
pushAction("stars_prize");
|
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) {});
|
}, [](v::null_t) {});
|
||||||
|
|
||||||
if (v::is_null(message.action.content)) {
|
if (v::is_null(message.action.content)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue