| 25 | namespace Api { |
| 26 | |
| 27 | struct GiftCode { |
| 28 | PeerId from = 0; |
| 29 | PeerId to = 0; |
| 30 | MsgId giveawayId = 0; |
| 31 | TimeId date = 0; |
| 32 | TimeId used = 0; // 0 if not used. |
| 33 | int days = 0; |
| 34 | bool giveaway = false; |
| 35 | |
| 36 | explicit operator bool() const { |
| 37 | return days != 0; |
| 38 | } |
| 39 | |
| 40 | friend inline bool operator==( |
| 41 | const GiftCode&, |
| 42 | const GiftCode&) = default; |
| 43 | }; |
| 44 | |
| 45 | enum class GiveawayState { |
| 46 | Invalid, |