data_subscriptions.h 805 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 PeerSubscription final {
  10. uint64 credits = 0;
  11. int period = 0;
  12. explicit operator bool() const {
  13. return credits > 0 && period > 0;
  14. }
  15. };
  16. struct SubscriptionEntry final {
  17. explicit operator bool() const {
  18. return !id.isEmpty();
  19. }
  20. QString id;
  21. QString inviteHash;
  22. QString title;
  23. QString slug;
  24. QDateTime until;
  25. PeerSubscription subscription;
  26. uint64 barePeerId = 0;
  27. uint64 photoId = 0;
  28. bool cancelled = false;
  29. bool cancelledByBot = false;
  30. bool expired = false;
  31. bool canRefulfill = false;
  32. };
  33. } // namespace Data