Skip to content

Commit

Permalink
Check that all shortcut messages are loaded before sending a message …
Browse files Browse the repository at this point in the history
…there.
  • Loading branch information
levlam committed Apr 22, 2024
1 parent c56c89f commit 2424d68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions td/telegram/QuickReplyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2794,6 +2794,9 @@ Result<QuickReplyManager::Shortcut *> QuickReplyManager::create_new_local_shortc
auto *s = get_shortcut(name);
auto max_message_count = td_->option_manager_->get_option_integer("quick_reply_shortcut_message_count_max");
if (s != nullptr) {
if (!have_all_shortcut_messages(s)) {
return Status::Error(400, "The quick reply shortcut must be loaded first");
}
max_message_count -= s->server_total_count_ + s->local_total_count_;
} else {
auto max_shortcut_count = td_->option_manager_->get_option_integer("quick_reply_shortcut_count_max");
Expand Down

0 comments on commit 2424d68

Please sign in to comment.