Fix mass redaction /command

This commit is contained in:
Nicolas Werner 2023-07-09 15:38:57 +02:00
parent 5abd4bb07a
commit 246a6d35f5
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -1490,9 +1490,12 @@ TimelineModel::redactEvent(const QString &id, const QString &reason)
[this, id, reason](const mtx::responses::EventId &, mtx::http::RequestErr err) { [this, id, reason](const mtx::responses::EventId &, mtx::http::RequestErr err) {
if (err) { if (err) {
if (err->status_code == 429 && err->matrix_error.retry_after.count() != 0) { if (err->status_code == 429 && err->matrix_error.retry_after.count() != 0) {
QTimer::singleShot(err->matrix_error.retry_after, this, [this, 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); this->redactEvent(id, reason);
}); });
});
return; return;
} }
emit redactionFailed(tr("Message redaction failed: %1") emit redactionFailed(tr("Message redaction failed: %1")