changelogs.h 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #include "base/weak_ptr.h"
  9. namespace Main {
  10. class Session;
  11. } // namespace Main
  12. namespace Core {
  13. [[nodiscard]] QString FormatVersionDisplay(int version);
  14. [[nodiscard]] QString FormatVersionPrecise(int version);
  15. class Changelogs final : public base::has_weak_ptr {
  16. public:
  17. Changelogs(not_null<Main::Session*> session, int oldVersion);
  18. static std::unique_ptr<Changelogs> Create(
  19. not_null<Main::Session*> session);
  20. private:
  21. void requestCloudLogs();
  22. void addLocalLogs();
  23. void addLocalLog(const QString &text);
  24. void addBetaLogs();
  25. void addBetaLog(int changeVersion, const char *changes);
  26. const not_null<Main::Session*> _session;
  27. const int _oldVersion = 0;
  28. rpl::lifetime _chatsSubscription;
  29. bool _addedSomeLocal = false;
  30. };
  31. } // namespace Core