summaryrefslogtreecommitdiffstats
path: root/Telegram/SourceFiles/core/changelogs.h
blob: ba5e312ff260c44da2493dc06b3cd813a6c43f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.

For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once

#include "base/weak_ptr.h"

namespace Main {
class Session;
} // namespace Main

namespace Core {

[[nodiscard]] QString FormatVersionDisplay(int version);
[[nodiscard]] QString FormatVersionPrecise(int version);

class Changelogs final : public base::has_weak_ptr {
public:
	Changelogs(not_null<Main::Session*> session, int oldVersion);

	static std::unique_ptr<Changelogs> Create(
		not_null<Main::Session*> session);

private:
	void requestCloudLogs();
	void addLocalLogs();
	void addLocalLog(const QString &text);
	void addBetaLogs();
	void addBetaLog(int changeVersion, const char *changes);

	const not_null<Main::Session*> _session;
	const int _oldVersion = 0;
	rpl::lifetime _chatsSubscription;
	bool _addedSomeLocal = false;

};

} // namespace Core