| 222 | } // namespace |
| 223 | |
| 224 | Session::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(); |
nothing calls this directly
no test coverage detected