Improve reading chat history.

GitOrigin-RevId: 82e2fc0ca2cbf1c59507fb74120732433ac15603
This commit is contained in:
levlam 2020-02-19 20:02:42 +03:00
parent 9862652e14
commit dafbedaefe
2 changed files with 3 additions and 3 deletions

View File

@ -15002,8 +15002,6 @@ Status MessagesManager::view_messages(DialogId dialog_id, const vector<MessageId
if (need_read && max_message_id > d->last_read_inbox_message_id) {
MessageId last_read_message_id = max_message_id;
MessageId prev_last_read_inbox_message_id = d->last_read_inbox_message_id;
read_history_inbox(d->dialog_id, last_read_message_id, -1, "view_messages");
if (dialog_id.get_type() != DialogType::SecretChat) {
if (last_read_message_id.get_prev_server_message_id().get() >
prev_last_read_inbox_message_id.get_prev_server_message_id().get()) {
@ -15014,6 +15012,8 @@ Status MessagesManager::view_messages(DialogId dialog_id, const vector<MessageId
read_history_on_server(d, last_read_message_id);
}
}
// read history on server after sending server request to not repair unread_count early
read_history_inbox(d->dialog_id, last_read_message_id, -1, "view_messages");
}
if (need_read && d->is_marked_as_unread) {
set_dialog_is_marked_as_unread(d, false);

View File

@ -432,7 +432,7 @@ class CliClient final : public Actor {
static char get_delimiter(Slice str) {
std::unordered_set<char> chars;
for (auto c : trim(str)) {
if (c < '0' || c > '9') {
if (!is_alnum(c)) {
chars.insert(c);
}
}