diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index ecf36981..0e4e8454 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -227,6 +227,8 @@ void NotificationManager::init() { current_notification_group_id_ = NotificationGroupId(to_integer(G()->td_db()->get_binlog_pmc()->get("notification_group_id_current"))); + VLOG(notifications) << "Loaded current " << current_notification_id_ << " and " << current_notification_group_id_; + on_notification_group_count_max_changed(false); on_notification_group_size_max_changed(); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 342d469d..a2334ab8 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -6444,6 +6444,8 @@ void Td::on_request(uint64 id, td_api::setOption &request) { CLEAN_INPUT_STRING(request.name_); int32 value_constructor_id = request.value_ == nullptr ? td_api::optionValueEmpty::ID : request.value_->get_id(); + LOG(INFO) << "Set option " << request.name_; + auto set_integer_option = [&](Slice name, int32 min = 0, int32 max = std::numeric_limits::max()) { if (request.name_ != name) { return false; @@ -6524,6 +6526,12 @@ void Td::on_request(uint64 id, td_api::setOption &request) { if (!is_bot && set_boolean_option("disable_top_chats")) { return; } + if (request.name_ == "drop_notification_ids") { + G()->td_db()->get_binlog_pmc()->erase("notification_id_current"); + G()->td_db()->get_binlog_pmc()->erase("notification_group_id_current"); + send_closure(actor_id(this), &Td::send_result, id, make_tl_object()); + return; + } break; case 'i': if (set_boolean_option("ignore_inline_thumbnails")) { diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index ff662eda..76f7a53a 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -811,6 +811,8 @@ class CliClient final : public Actor { td_api::make_object(false))); send_request(td_api::make_object( "use_pfs", td_api::make_object(std::time(nullptr) / 86400 % 2 == 0))); + send_request(td_api::make_object("disable_contact_registered_notifications", + td_api::make_object(true))); send_request(td_api::make_object(td_api::make_object())); send_request(td_api::make_object()); @@ -827,8 +829,6 @@ class CliClient final : public Actor { bad_parameters->api_hash_ = api_hash_; send_request(td_api::make_object(std::move(bad_parameters))); } - send_request(td_api::make_object("disable_contact_registered_notifications", - td_api::make_object(true))); } void init() {