MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / Session

Method Session

Telegram/SourceFiles/data/data_session.cpp:224–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222} // namespace
223
224Session::Session(not_null<Main::Session*> session)
225: _session(session)
226, _cache(Core::App().databases().get(
227 _session->local().cachePath(),
228 _session->local().cacheSettings()))
229, _bigFileCache(Core::App().databases().get(
230 _session->local().cacheBigFilePath(),
231 _session->local().cacheBigFileSettings()))
232, _groupFreeTranscribeLevel(session->appConfig().value(
233) | rpl::map([limits = Data::LevelLimits(session)] {
234 return limits.groupTranscribeLevelMin();
235}))
236, _chatsList(
237 session,
238 FilterId(),
239 maxPinnedChatsLimitValue(nullptr))
240, _contactsList(Dialogs::SortMode::Name)
241, _contactsNoChatsList(Dialogs::SortMode::Name)
242, _ttlCheckTimer([=] { checkTTLs(); })
243, _formattedDateTimer([=] { checkFormattedDateUpdates(); })
244, _selfDestructTimer([=] { checkSelfDestructItems(); })
245, _pollsClosingTimer([=] { checkPollsClosings(); })
246, _watchForOfflineTimer([=] { checkLocalUsersWentOffline(); })
247, _groups(this)
248, _aiComposeTones(std::make_unique<AiComposeTones>(session))
249, _chatsFilters(std::make_unique<ChatFilters>(this))
250, _cloudThemes(std::make_unique<CloudThemes>(session))
251, _sendActionManager(std::make_unique<SendActionManager>())
252, _streaming(std::make_unique<Streaming>(this))
253, _mediaRotation(std::make_unique<MediaRotation>())
254, _histories(std::make_unique<Histories>(this))
255, _stickers(std::make_unique<Stickers>(this))
256, _reactions(std::make_unique<Reactions>(this))
257, _emojiStatuses(std::make_unique<EmojiStatuses>(this))
258, _forumIcons(std::make_unique<ForumIcons>(this))
259, _notifySettings(std::make_unique<NotifySettings>(this))
260, _customEmojiManager(std::make_unique<CustomEmojiManager>(this))
261, _stories(std::make_unique<Stories>(this))
262, _savedMusic(std::make_unique<SavedMusic>(this))
263, _savedMessages(std::make_unique<SavedMessages>(this))
264, _chatbots(std::make_unique<Chatbots>(this))
265, _businessInfo(std::make_unique<BusinessInfo>(this))
266, _shortcutMessages(std::make_unique<ShortcutMessages>(this)) {
267 _cache->open(_session->local().cacheKey());
268 _bigFileCache->open(_session->local().cacheBigFileKey());
269
270 if constexpr (Platform::IsLinux()) {
271 const auto wasVersion = _session->local().oldMapVersion();
272 if (wasVersion >= 1007011 && wasVersion < 1007015) {
273 _bigFileCache->clear();
274 _cache->clearByTag(Data::kImageCacheTag);
275 }
276 }
277
278 setupMigrationViewer();
279 setupChannelLeavingViewer();
280 setupPeerNameViewer();
281 setupUserIsContactViewer();

Callers

nothing calls this directly

Calls 15

AppClass · 0.85
LevelLimitsClass · 0.85
AmPremiumValueFunction · 0.85
GetEnhancedBoolFunction · 0.85
cachePathMethod · 0.80
cacheSettingsMethod · 0.80
cacheBigFilePathMethod · 0.80
cacheBigFileSettingsMethod · 0.80
cacheBigFileKeyMethod · 0.80
oldMapVersionMethod · 0.80
unreadStateChangesMethod · 0.80

Tested by

no test coverage detected