Update shortcut message count with the number of known messages.

This commit is contained in:
levlam 2024-02-22 18:47:01 +03:00
parent 96ddf0441c
commit ef90da3fd1
1 changed files with 3 additions and 2 deletions

View File

@ -238,8 +238,9 @@ td_api::object_ptr<td_api::quickReplyShortcut> QuickReplyManager::get_quick_repl
const Shortcut *s, const char *source) const {
CHECK(s != nullptr);
CHECK(!s->messages_.empty());
return td_api::make_object<td_api::quickReplyShortcut>(
s->name_, get_quick_reply_message_object(s->messages_[0].get(), source), s->total_count_);
return td_api::make_object<td_api::quickReplyShortcut>(s->name_,
get_quick_reply_message_object(s->messages_[0].get(), source),
max(s->total_count_, static_cast<int32>(s->messages_.size())));
}
td_api::object_ptr<td_api::quickReplyShortcuts> QuickReplyManager::get_quick_reply_shortcuts_object(