Update spaces events automatically in the background

This commit is contained in:
Nicolas Werner 2023-03-14 03:02:54 +01:00
parent 9891b6bffe
commit 234ac79acc
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
7 changed files with 246 additions and 5 deletions

View file

@ -727,9 +727,12 @@ struct PowerLevelApplier
[self = *this](const mtx::responses::EventId &, mtx::http::RequestErr e) mutable {
if (e) {
if (e->status_code == 429 && e->matrix_error.retry_after.count() != 0) {
QTimer::singleShot(e->matrix_error.retry_after,
ChatPage::instance(),
[self = std::move(self)]() mutable { self.next(); });
ChatPage::instance()->callFunctionOnGuiThread(
[self = std::move(self), interval = e->matrix_error.retry_after]() {
QTimer::singleShot(interval,
ChatPage::instance(),
[self = std::move(self)]() mutable { self.next(); });
});
return;
}