mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Try to reset unread marker if we fail to set it on the server
This commit is contained in:
parent
d7af10f06d
commit
1a97a36dd2
1 changed files with 7 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue