diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-07-09 15:38:57 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-07-09 15:42:38 +0200 |
commit | 246a6d35f538518140604d40396c6126f7e3f4aa (patch) | |
tree | 5bb6ef63cff1e7562ca73bc4c3084be3fdc16efb /src | |
parent | Merge pull request #1517 from Nheko-Reborn/fixMessagePowerlevelPlaceholder (diff) | |
download | nheko-246a6d35f538518140604d40396c6126f7e3f4aa.tar.xz |
Fix mass redaction /command
Diffstat (limited to 'src')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 22fe63d4..752aedb0 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1490,9 +1490,12 @@ TimelineModel::redactEvent(const QString &id, const QString &reason) [this, id, reason](const mtx::responses::EventId &, mtx::http::RequestErr err) { if (err) { if (err->status_code == 429 && err->matrix_error.retry_after.count() != 0) { - QTimer::singleShot(err->matrix_error.retry_after, this, [this, id, reason]() { - this->redactEvent(id, reason); - }); + ChatPage::instance()->callFunctionOnGuiThread( + [this, id, reason, interval = err->matrix_error.retry_after] { + QTimer::singleShot(interval * 2, this, [this, id, reason]() { + this->redactEvent(id, reason); + }); + }); return; } emit redactionFailed(tr("Message redaction failed: %1") |