Try to reset unread marker if we fail to set it on the server

This commit is contained in:
Nicolas Werner 2023-04-05 01:49:11 +02:00
parent d7af10f06d
commit 1a97a36dd2
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -1264,10 +1264,14 @@ TimelineModel::readEvent(const std::string &id)
http::client()->read_event(
room_id_.toStdString(),
id,
[this](mtx::http::RequestErr err) {
[this, newId = id, oldId = currentReadId](mtx::http::RequestErr err) {
if (err) {
nhlog::net()->warn(
"failed to read_event ({}, {})", room_id_.toStdString(), currentId.toStdString());
nhlog::net()->warn("failed to read_event ({}, {})", room_id_.toStdString(), newId);
ChatPage::instance()->callFunctionOnGuiThread([this, newId, oldId] {
if (currentReadId.toStdString() == newId)
this->currentReadId = oldId;
});
}
},
!UserSettings::instance()->readReceipts());