From e9ba26c4f054012a4d526be5cfa63f0d45370f90 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 28 Apr 2018 21:05:04 +0300 Subject: [PATCH] Default disable_notification support. GitOrigin-RevId: 014a8b141dc1cff5126748c7785ea22d12aef7b3 --- td/generate/scheme/td_api.tl | 9 +- td/generate/scheme/td_api.tlo | Bin 124240 -> 124632 bytes td/telegram/MessagesManager.cpp | 151 ++++++++++++++++++++++++++++++-- td/telegram/MessagesManager.h | 11 +++ td/telegram/SecureManager.cpp | 1 + td/telegram/Td.cpp | 7 ++ td/telegram/Td.h | 2 + td/telegram/TdDb.cpp | 1 + td/telegram/cli.cpp | 6 ++ td/telegram/logevent/LogEvent.h | 1 + 10 files changed, 181 insertions(+), 8 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 00dd9a47..b997a5a9 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -530,6 +530,7 @@ chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType; //@order Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined //@is_pinned True, if the chat is pinned //@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat +//@default_disable_notification Default value of disable_notification parameter, used when a message is sent to the chat //@unread_count Number of unread messages in the chat //@last_read_inbox_message_id Identifier of the last read incoming message //@last_read_outbox_message_id Identifier of the last read outgoing message @@ -538,7 +539,7 @@ chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType; //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null //@client_data Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if a message database is used -chat id:int53 type:ChatType title:string photo:chatPhoto last_message:message order:int64 is_pinned:Bool can_be_reported:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhoto last_message:message order:int64 is_pinned:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @chat_ids List of chat identifiers chats chat_ids:vector = Chats; @@ -2057,6 +2058,9 @@ updateChatOrder chat_id:int53 order:int64 = Update; //@description A chat was pinned or unpinned @chat_id Chat identifier @is_pinned New value of is_pinned @order New value of the chat order updateChatIsPinned chat_id:int53 is_pinned:Bool order:int64 = Update; +//@description A value of default disable_notification parameter, used when a message is sent to the chat, was changed @chat_id Chat identifier @default_disable_notification The new default_disable_notification value +updateChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Update; + //@description Incoming messages were read or number of unread messages has been changed @chat_id Chat identifier @last_read_inbox_message_id Identifier of the last read incoming message @unread_count The number of unread messages left in the chat updateChatReadInbox chat_id:int53 last_read_inbox_message_id:int53 unread_count:int32 = Update; @@ -2621,6 +2625,9 @@ setChatNotificationSettings chat_id:int53 notification_settings:chatNotification //@description Changes the pinned state of a chat. You can pin up to GetOption("pinned_chat_count_max") non-secret chats and the same number of secret chats @chat_id Chat identifier @is_pinned New value of is_pinned toggleChatIsPinned chat_id:int53 is_pinned:Bool = Ok; +//@description Changes the value of default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification +toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok; + //@description Changes client data associated with a chat @chat_id Chat identifier @client_data New value of client_data setChatClientData chat_id:int53 client_data:string = Ok; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 5af2693e5497954b0c6894a362a0df38f10cebe8..f679e8e7bc6dbbfcc55c2fca0b2e9132dbb34790 100644 GIT binary patch delta 1941 zcmZ`)VMtq76wax!)naL?wm$G}JZ8Ek8kf{Yeb%T?6J5q+OQD7Qkj>1-#*xjaFPno2 z8LVa9{1Ld|6_zofGFFh`$XJ94wM@ns7SiEH2E~Q_82b^1gZ;hzf9~ny*Amwwdeowl8EDEj zJ|R`XP_|u}J9pL~OfZ7QV&V2r-_(zuA(40k+05EVq3h3D`FeCRl8oyw)6d@pcXp>c z0ahNF)p~Y+xAN>%a)3`*VF%cSm2$wMuxw872uo{+tHR1S!6mF6CxnINXaz?t&&M@b z=|d+xPxe2qrgvN6MGnVby_`nYzLZHq zsS!R~I|?}zw`^iY{Fv%Gj1N5nii#qE4XydtpPkn70NGzlP2a8id_3I8f3yDME{++4 z`joMax=RmGoZ>!&+R3TcPScbd8ilxJH#S)Gu(tNyFe)6Hr-DQmI-y128y@VG5p<2$ z6e=v1AD%op_Tj5{o9#(s75I(>#K8up<|41eqc2SBQA-|j@EtDQ*9cfuE<)O%fs8B;EHK|nYh-AD^{L&*O4 zH2-$o9yuwdd2KE_D<-zxjlKM3vK1A)B4b#^j42b_FtMVENj(^+_2B1`=`lBT54=m4 zF{gUDj4u_zOEV_E%kaYqk~8OY&v9GzZG!93w_9~>4%tL=>4FW^^ei}b#Q^izPHice%$?1KeFTjNR(9! zAhtDNsu;l2lRpCw4QqH6Eo&9m3D7GV_(c}mAToS|_(3h2*v26CQZg}RnB6u$KLqLe z5FSinsA9a;bZ{8lJR~D(Jo1-okbJ8|l>mGz@KOM?vz&+xW9-(O67`HgTEuRTl)EMQ zTMQopl?I+gk}YU95yX@U#7HVBk(Iti;#-ht5z$=Tb1;7v8ge&Zf`96bJDh54m8h0v zP4PR67H43^ut;$_Kx`k#w3vq4D(>2!#h}a`R*;A1M(02gj{!~SFfVeHbPQx)jjJMg z%q){mvePpP?j%_o+%lHe6q3982COxRknx*XPJJJOvH_CCpw}>Ro1cK%XgquT)nJ=k zbPI>)E7*QY;@>QH{O2aF+k^G<_2XaH+x6)iH{#L%zYpodAEAk^++z!ST#vsUqG(<7g7aCHUIzs delta 1772 zcmY*aUuaWj6whf>O{HV8)*0|R?v_epdz;?Xw7qSUHf?H~u!>i#Aege$t)mYUV*iNa<_Ka%{H@MrpLxuX9vqVwInzVS2or8@L#79j_W=M zqP5_I`f39+gq8fKMrh!!bD;9NBcLKBYFqlZFoM{_BcRx_3PbieyL{7y&O{^l(3)?A zMYIA;HiLpzsfYq$X+O-N^E*GtXf63c z@)&J{I2q$N8QG<{LRbDY51?rCiuWn)nHJItteO4y$A>HvtEt(cE3}lgp>UrH!Djz9p+>fHEQB9sneZQmexrD6E=3u z#@1}?t&PcDa0ZLH)I~Q){s#iQ*hN7--IjytBLRM?oA4EZmyV8YzG>j@Am!JBAlXjf zo6q0?%fxG#+iN|7`5>iR4Z<>(kPH!)3DF2PLLi}cJ4BtUJ!Gvvq1$<@hqNzxU;-5* zy&&5~RItql4NUvm%~yJ%4hi{Q5^eWF(kdcMSSD;25vB=l-vE`xf2iiS``{=FQhngF zvjG3B4ZipPI-MmL3%ETpEBVUx?5_-inl+auxq%5Lyh%bqu^Z zV1;9aMo;<}tRtL1X2li}2^u8kTFA%cA-Igx#UZO*miW=b-4W23bmusa4T*s%>+zk> zdn-!SOEIcmk5ORtjgN1QgY@&+DmHo;-*@g+3{v}{HaGqSystI)EI03$JS#dh_77j1 zgp9e^jTKwL_nv@mR`ANK5OE=)FlABM!YS2+a>_KwxV5=HBle{kC_h6X#dA`4DMQrG zm7EnLHOWh}qHM!5Z?( promise_; DialogId dialog_id_; public: + explicit UpdateDialogNotifySettingsQuery(Promise &&promise) : promise_(std::move(promise)) { + } + void send(DialogId dialog_id, const DialogNotificationSettings &new_settings) { auto input_notify_peer = td->messages_manager_->get_input_notify_peer(dialog_id); if (input_notify_peer == nullptr) { @@ -3007,18 +3011,21 @@ class UpdateDialogNotifySettingsQuery : public Td::ResultHandler { if (!result) { return on_error(id, Status::Error(400, "Receive false as result")); } + + promise_.set_value(Unit()); } void on_error(uint64 id, Status status) override { if (!td->messages_manager_->on_get_dialog_error(dialog_id_, status, "UpdateDialogNotifySettingsQuery")) { LOG(INFO) << "Receive error for set chat notification settings: " << status; - status.ignore(); } if (!td->auth_manager_->is_bot() && td->messages_manager_->get_input_notify_peer(dialog_id_) != nullptr) { // trying to repair notification settings for this dialog td->create_handler(Promise<>())->send(dialog_id_); } + + promise_.set_error(std::move(status)); } }; @@ -6267,8 +6274,10 @@ bool MessagesManager::update_dialog_notification_settings(DialogId dialog_id, current_settings->use_default_mute_until != new_settings.use_default_mute_until || current_settings->use_default_sound != new_settings.use_default_sound || current_settings->use_default_show_preview != new_settings.use_default_show_preview; - bool is_changed = need_update || current_settings->is_synchronized != new_settings.is_synchronized || - current_settings->silent_send_message != new_settings.silent_send_message || + bool need_update_default_disable_notification = + current_settings->silent_send_message != new_settings.silent_send_message; + bool is_changed = need_update || need_update_default_disable_notification || + current_settings->is_synchronized != new_settings.is_synchronized || current_settings->is_use_default_fixed != new_settings.is_use_default_fixed; if (is_changed) { @@ -6287,6 +6296,11 @@ bool MessagesManager::update_dialog_notification_settings(DialogId dialog_id, make_tl_object( dialog_id.get(), get_chat_notification_settings_object(current_settings))); } + if (need_update_default_disable_notification) { + send_closure(G()->td(), &Td::send_update, + make_tl_object(dialog_id.get(), + current_settings->silent_send_message)); + } } return is_changed; } @@ -6476,6 +6490,24 @@ void MessagesManager::on_update_scope_notify_settings( update_scope_notification_settings(scope, get_scope_notification_settings(scope), notification_settings); } +bool MessagesManager::update_dialog_silent_send_message(Dialog *d, bool silent_send_message) { + CHECK(d != nullptr); + LOG_IF(WARNING, !d->notification_settings.is_synchronized) + << "Have unknown notification settings in " << d->dialog_id; + if (d->notification_settings.silent_send_message == silent_send_message) { + return false; + } + + LOG(INFO) << "Update silent send message in " << d->dialog_id << " to " << silent_send_message; + d->notification_settings.silent_send_message = silent_send_message; + + on_dialog_updated(d->dialog_id, "update_dialog_silent_send_message"); + + send_closure(G()->td(), &Td::send_update, + make_tl_object(d->dialog_id.get(), silent_send_message)); + return true; +} + bool MessagesManager::get_dialog_report_spam_state(DialogId dialog_id, Promise &&promise) { Dialog *d = get_dialog_force(dialog_id); if (d == nullptr) { @@ -12464,6 +12496,90 @@ void MessagesManager::reorder_pinned_dialogs_on_server(const vector &d td_->create_handler(std::move(promise))->send(dialog_ids); } +Status MessagesManager::toggle_dialog_silent_send_message(DialogId dialog_id, bool silent_send_message) { + CHECK(!td_->auth_manager_->is_bot()); + + Dialog *d = get_dialog_force(dialog_id); + if (d == nullptr) { + return Status::Error(6, "Chat not found"); + } + if (!have_input_peer(dialog_id, AccessRights::Read)) { + return Status::Error(6, "Can't access the chat"); + } + + if (update_dialog_silent_send_message(d, silent_send_message)) { + save_dialog_notification_settings_on_server(dialog_id, false); + } + + return Status::OK(); +} + +class MessagesManager::SaveDialogNotificationSettingsOnServerLogEvent { + public: + DialogId dialog_id_; + + template + void store(StorerT &storer) const { + td::store(dialog_id_, storer); + } + + template + void parse(ParserT &parser) { + td::parse(dialog_id_, parser); + } +}; + +void MessagesManager::save_dialog_notification_settings_on_server(DialogId dialog_id, bool from_binlog) { + auto d = get_dialog(dialog_id); + CHECK(d != nullptr); + + if (!from_binlog && G()->parameters().use_message_db) { + LOG(INFO) << "Save notification settings of " << dialog_id << " to binlog"; + SaveDialogNotificationSettingsOnServerLogEvent logevent; + logevent.dialog_id_ = dialog_id; + auto storer = LogEventStorerImpl(logevent); + if (d->save_notification_settings_logevent_id == 0) { + d->save_notification_settings_logevent_id = BinlogHelper::add( + G()->td_db()->get_binlog(), LogEvent::HandlerType::SaveDialogNotificationSettingsOnServer, storer); + LOG(INFO) << "Add notification settings logevent " << d->save_notification_settings_logevent_id; + } else { + auto new_logevent_id = + BinlogHelper::rewrite(G()->td_db()->get_binlog(), d->save_notification_settings_logevent_id, + LogEvent::HandlerType::SaveDialogNotificationSettingsOnServer, storer); + LOG(INFO) << "Rewrite notification settings logevent " << d->save_notification_settings_logevent_id << " with " + << new_logevent_id; + } + d->save_notification_settings_logevent_id_generation++; + } + + Promise<> promise; + if (d->save_notification_settings_logevent_id != 0) { + promise = PromiseCreator::lambda( + [actor_id = actor_id(this), dialog_id, + generation = d->save_notification_settings_logevent_id_generation](Result result) mutable { + if (!G()->close_flag()) { + send_closure(actor_id, &MessagesManager::on_saved_dialog_notification_settings, dialog_id, generation); + } + }); + } + + // TODO do not send two queries simultaneously or use SequenceDispatcher + td_->create_handler(std::move(promise))->send(dialog_id, d->notification_settings); +} + +void MessagesManager::on_saved_dialog_notification_settings(DialogId dialog_id, uint64 generation) { + auto d = get_dialog(dialog_id); + CHECK(d != nullptr); + LOG(INFO) << "Saved notification settings in " << dialog_id << " with logevent " + << d->save_notification_settings_logevent_id; + if (d->save_notification_settings_logevent_id_generation == generation) { + CHECK(d->save_notification_settings_logevent_id != 0); + LOG(INFO) << "Delete notification settings logevent " << d->save_notification_settings_logevent_id; + BinlogHelper::erase(G()->td_db()->get_binlog(), d->save_notification_settings_logevent_id); + d->save_notification_settings_logevent_id = 0; + } +} + Status MessagesManager::set_dialog_client_data(DialogId dialog_id, string &&client_data) { Dialog *d = get_dialog_force(dialog_id); if (d == nullptr) { @@ -12994,8 +13110,9 @@ tl_object_ptr MessagesManager::get_chat_object(const Dialog *d) { get_chat_photo_object(td_->file_manager_.get(), get_dialog_photo(d->dialog_id)), get_message_object(d->dialog_id, get_message(d, d->last_message_id)), DialogDate(d->order, d->dialog_id) <= last_dialog_date_ ? d->order : 0, d->pinned_order != DEFAULT_ORDER, - can_report_dialog(d->dialog_id), d->server_unread_count + d->local_unread_count, - d->last_read_inbox_message_id.get(), d->last_read_outbox_message_id.get(), d->unread_mention_count, + can_report_dialog(d->dialog_id), d->notification_settings.silent_send_message, + d->server_unread_count + d->local_unread_count, d->last_read_inbox_message_id.get(), + d->last_read_outbox_message_id.get(), d->unread_mention_count, get_chat_notification_settings_object(&d->notification_settings), d->reply_markup_message_id.get(), get_draft_message_object(d->draft_message), d->client_data); } @@ -13166,7 +13283,7 @@ Status MessagesManager::set_dialog_notification_settings( std::move(notification_settings->sound_), notification_settings->use_default_show_preview_, notification_settings->show_preview_, current_settings->silent_send_message); if (update_dialog_notification_settings(dialog_id, current_settings, new_settings)) { - td_->create_handler()->send(dialog_id, new_settings); + save_dialog_notification_settings_on_server(dialog_id, false); } return Status::OK(); } @@ -15122,7 +15239,7 @@ MessagesManager::Message *MessagesManager::get_message_to_send(Dialog *d, Messag m->content = std::move(content); m->forward_info = std::move(forward_info); - if (td_->auth_manager_->is_bot()) { + if (td_->auth_manager_->is_bot() || disable_notification) { m->disable_notification = disable_notification; } else { auto notification_settings = get_dialog_notification_settings(dialog_id, true); @@ -25106,6 +25223,26 @@ void MessagesManager::on_binlog_events(vector &&events) { save_dialog_draft_message_on_server(dialog_id); break; } + case LogEvent::HandlerType::SaveDialogNotificationSettingsOnServer: { + if (!G()->parameters().use_message_db) { + BinlogHelper::erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + SaveDialogNotificationSettingsOnServerLogEvent log_event; + log_event_parse(log_event, event.data_).ensure(); + + auto dialog_id = log_event.dialog_id_; + Dialog *d = get_dialog_force(dialog_id); + if (d == nullptr || !have_input_peer(dialog_id, AccessRights::Read)) { + BinlogHelper::erase(G()->td_db()->get_binlog(), event.id_); + break; + } + d->save_notification_settings_logevent_id = event.id_; + + save_dialog_notification_settings_on_server(dialog_id, true); + break; + } case LogEvent::HandlerType::GetChannelDifference: { GetChannelDifferenceLogEvent log_event; log_event_parse(log_event, event.data_).ensure(); diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index ab5f0841..312907d8 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -1223,6 +1223,8 @@ class MessagesManager : public Actor { Status toggle_dialog_is_pinned(DialogId dialog_id, bool is_pinned) TD_WARN_UNUSED_RESULT; + Status toggle_dialog_silent_send_message(DialogId dialog_id, bool silent_send_message) TD_WARN_UNUSED_RESULT; + Status set_pinned_dialogs(vector dialog_ids) TD_WARN_UNUSED_RESULT; Status set_dialog_client_data(DialogId dialog_id, string &&client_data) TD_WARN_UNUSED_RESULT; @@ -1577,6 +1579,8 @@ class MessagesManager : public Actor { unique_ptr draft_message; uint64 save_draft_message_logevent_id = 0; uint64 save_draft_message_logevent_id_generation = 0; + uint64 save_notification_settings_logevent_id = 0; + uint64 save_notification_settings_logevent_id_generation = 0; MessageId last_read_all_mentions_message_id; // all mentions with a message id not greater than it are implicitly read @@ -1835,6 +1839,7 @@ class MessagesManager : public Actor { class ReadMessageContentsOnServerLogEvent; class ReorderPinnedDialogsOnServerLogEvent; class SaveDialogDraftMessageOnServerLogEvent; + class SaveDialogNotificationSettingsOnServerLogEvent; class SendBotStartMessageLogEvent; class SendInlineQueryResultMessageLogEvent; class SendMessageLogEvent; @@ -2251,6 +2256,8 @@ class MessagesManager : public Actor { void on_scope_unmute(NotificationSettingsScope scope); + bool update_dialog_silent_send_message(Dialog *d, bool silent_send_message); + void on_send_dialog_action_timeout(DialogId dialog_id); void on_active_dialog_action_timeout(DialogId dialog_id); @@ -2475,6 +2482,10 @@ class MessagesManager : public Actor { void on_saved_dialog_draft_message(DialogId dialog_id, uint64 generation); + void save_dialog_notification_settings_on_server(DialogId dialog_id, bool from_binlog); + + void on_saved_dialog_notification_settings(DialogId dialog_id, uint64 generation); + int64 get_next_pinned_dialog_order(); void update_dialog_pos(Dialog *d, bool remove_from_dialog_list, const char *source, diff --git a/td/telegram/SecureManager.cpp b/td/telegram/SecureManager.cpp index 0a6a1df8..45588ff2 100644 --- a/td/telegram/SecureManager.cpp +++ b/td/telegram/SecureManager.cpp @@ -8,6 +8,7 @@ #include "td/telegram/ContactsManager.h" #include "td/telegram/DialogId.h" +#include "td/telegram/files/FileId.h" #include "td/telegram/files/FileManager.h" #include "td/telegram/Global.h" #include "td/telegram/misc.h" diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index acf46934..4e9fdda0 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -6013,6 +6013,13 @@ void Td::on_request(uint64 id, const td_api::toggleChatIsPinned &request) { answer_ok_query(id, messages_manager_->toggle_dialog_is_pinned(DialogId(request.chat_id_), request.is_pinned_)); } +void Td::on_request(uint64 id, const td_api::toggleChatDefaultDisableNotification &request) { + CHECK_AUTH(); + CHECK_IS_USER(); + answer_ok_query(id, messages_manager_->toggle_dialog_silent_send_message(DialogId(request.chat_id_), + request.default_disable_notification_)); +} + void Td::on_request(uint64 id, const td_api::setPinnedChats &request) { CHECK_AUTH(); CHECK_IS_USER(); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index fa62d584..a1bddbb5 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -547,6 +547,8 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, const td_api::toggleChatIsPinned &request); + void on_request(uint64 id, const td_api::toggleChatDefaultDisableNotification &request); + void on_request(uint64 id, const td_api::setPinnedChats &request); void on_request(uint64 id, td_api::setChatClientData &request); diff --git a/td/telegram/TdDb.cpp b/td/telegram/TdDb.cpp index 6cf8c67e..46d2139b 100644 --- a/td/telegram/TdDb.cpp +++ b/td/telegram/TdDb.cpp @@ -82,6 +82,7 @@ Status init_binlog(Binlog &binlog, string path, BinlogKeyValue &binlog_p case LogEvent::HandlerType::ToggleDialogIsPinnedOnServer: case LogEvent::HandlerType::ReorderPinnedDialogsOnServer: case LogEvent::HandlerType::SaveDialogDraftMessageOnServer: + case LogEvent::HandlerType::SaveDialogNotificationSettingsOnServer: case LogEvent::HandlerType::GetChannelDifference: events.to_messages_manager.push_back(event.clone()); break; diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 0ae74260..1b65ac92 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2194,6 +2194,12 @@ class CliClient final : public Actor { string is_pinned; std::tie(chat_id, is_pinned) = split(args); send_request(make_tl_object(as_chat_id(chat_id), as_bool(is_pinned))); + } else if (op == "tcddn") { + string chat_id; + string default_disable_notification; + std::tie(chat_id, default_disable_notification) = split(args); + send_request(make_tl_object(as_chat_id(chat_id), + as_bool(default_disable_notification))); } else if (op == "spchats") { vector chat_ids_str = full_split(args, ' '); vector chat_ids; diff --git a/td/telegram/logevent/LogEvent.h b/td/telegram/logevent/LogEvent.h index 9275c6fa..41e885af 100644 --- a/td/telegram/logevent/LogEvent.h +++ b/td/telegram/logevent/LogEvent.h @@ -83,6 +83,7 @@ class LogEvent { ToggleDialogIsPinnedOnServer = 0x10c, ReorderPinnedDialogsOnServer = 0x10d, SaveDialogDraftMessageOnServer = 0x10e, + SaveDialogNotificationSettingsOnServer = 0x10f, GetChannelDifference = 0x140, ConfigPmcMagic = 0x1f18, BinlogPmcMagic = 0x4327