fix: reactions and mentions not being read locally

This commit is contained in:
ZavaruKitsu 2023-12-26 12:38:32 +03:00
parent 0eab40b22f
commit 2c6439eeb6

View file

@ -1318,11 +1318,6 @@ void ApiWrap::migrateFail(not_null<PeerData*> peer, const QString &error) {
void ApiWrap::markContentsRead(
const base::flat_set<not_null<HistoryItem*>> &items) {
const auto settings = &AyuSettings::getInstance();
if (!settings->sendReadMessages) {
return;
}
auto markedIds = QVector<MTPint>();
auto channelMarkedIds = base::flat_map<
not_null<ChannelData*>,
@ -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<MTPint>(markedIds)