From 2c6439eeb6a400530d6950f3467cce84a0dc2dc6 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu Date: Tue, 26 Dec 2023 12:38:32 +0300 Subject: [PATCH] fix: reactions and mentions not being read locally --- Telegram/SourceFiles/apiwrap.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index e8c8046cc..35522ae5f 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -1318,11 +1318,6 @@ void ApiWrap::migrateFail(not_null peer, const QString &error) { void ApiWrap::markContentsRead( const base::flat_set> &items) { - const auto settings = &AyuSettings::getInstance(); - if (!settings->sendReadMessages) { - return; - } - auto markedIds = QVector(); auto channelMarkedIds = base::flat_map< not_null, @@ -1338,6 +1333,12 @@ void ApiWrap::markContentsRead( markedIds.push_back(MTP_int(item->id)); } } + + const auto settings = &AyuSettings::getInstance(); + if (!settings->sendReadMessages) { + return; + } + if (!markedIds.isEmpty()) { request(MTPmessages_ReadMessageContents( MTP_vector(markedIds)