data_boosts.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. namespace Data {
  9. struct BoostsOverview final {
  10. bool group = false;
  11. int mine = 0;
  12. int level = 0;
  13. int boostCount = 0;
  14. int currentLevelBoostCount = 0;
  15. int nextLevelBoostCount = 0;
  16. int premiumMemberCount = 0;
  17. float64 premiumMemberPercentage = 0;
  18. };
  19. struct GiftCodeLink final {
  20. QString text;
  21. QString link;
  22. QString slug;
  23. };
  24. struct Boost final {
  25. QString id;
  26. UserId userId = UserId(0);
  27. FullMsgId giveawayMessage;
  28. QDateTime date;
  29. QDateTime expiresAt;
  30. int expiresAfterMonths = 0;
  31. GiftCodeLink giftCodeLink;
  32. int multiplier = 0;
  33. uint64 credits = 0;
  34. bool isGift = false;
  35. bool isGiveaway = false;
  36. bool isUnclaimed = false;
  37. };
  38. struct BoostsListSlice final {
  39. struct OffsetToken final {
  40. QString next;
  41. bool gifts = false;
  42. };
  43. std::vector<Boost> list;
  44. int multipliedTotal = 0;
  45. bool allLoaded = false;
  46. OffsetToken token;
  47. };
  48. struct BoostPrepaidGiveaway final {
  49. QDateTime date;
  50. uint64 id = 0;
  51. uint64 credits = 0;
  52. int months = 0;
  53. int quantity = 0;
  54. int boosts = 0;
  55. };
  56. struct BoostStatus final {
  57. BoostsOverview overview;
  58. BoostsListSlice firstSliceBoosts;
  59. BoostsListSlice firstSliceGifts;
  60. std::vector<BoostPrepaidGiveaway> prepaidGiveaway;
  61. QString link;
  62. };
  63. } // namespace Data