This commit is contained in:
Andrea Cavalli 2020-10-01 15:28:16 +02:00
parent f6d7221e75
commit 235e766c5d

View File

@ -10323,7 +10323,7 @@ int32 MessagesManager::get_unload_dialog_delay() const {
constexpr int32 DIALOG_UNLOAD_DELAY = 60; // seconds
constexpr int32 DIALOG_UNLOAD_BOT_DELAY = 1800; // seconds
auto default_value = td_->auth_manager_->is_bot() ? DIALOG_UNLOAD_BOT_DELAY : DIALOG_UNLOAD_DELAY;
return static_cast<int32>(G()->shared_config().get_option_integer("chat_unload_delay", default_value));
return narrow_cast<int32>(G()->shared_config().get_option_integer("chat_unload_delay", default_value));
}
void MessagesManager::unload_dialog(DialogId dialog_id) {
@ -13988,7 +13988,7 @@ void MessagesManager::dump_debug_message_op(const Dialog *d, int priority) {
}
bool MessagesManager::is_message_unload_enabled() const {
auto has_custom_unload_time = G()->shared_config().get_option_integer("unload_messages_after_seconds", -1) != -1;
auto has_custom_unload_time = G()->shared_config().have_option("chat_unload_delay");
return G()->parameters().use_message_db || td_->auth_manager_->is_bot() || has_custom_unload_time;
}