mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Try to handle rate limiting
This commit is contained in:
parent
683fd75700
commit
ce2d4defde
3 changed files with 9 additions and 3 deletions
|
@ -581,7 +581,7 @@ if(USE_BUNDLED_MTXCLIENT)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
MatrixClient
|
MatrixClient
|
||||||
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
|
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
|
||||||
GIT_TAG 8dd9214f622fe5f307249b37029c17f1fdff25ab
|
GIT_TAG b3740e26ad07a534b6092959c0da4d91b77a8528
|
||||||
)
|
)
|
||||||
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
|
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
|
||||||
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
||||||
|
|
|
@ -173,7 +173,7 @@ modules:
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
name: mtxclient
|
name: mtxclient
|
||||||
sources:
|
sources:
|
||||||
- commit: 8dd9214f622fe5f307249b37029c17f1fdff25ab
|
- commit: b3740e26ad07a534b6092959c0da4d91b77a8528
|
||||||
#tag: v0.8.2
|
#tag: v0.8.2
|
||||||
type: git
|
type: git
|
||||||
url: https://github.com/Nheko-Reborn/mtxclient.git
|
url: https://github.com/Nheko-Reborn/mtxclient.git
|
||||||
|
|
|
@ -1313,8 +1313,14 @@ TimelineModel::redactEvent(const QString &id, const QString &reason)
|
||||||
http::client()->redact_event(
|
http::client()->redact_event(
|
||||||
room_id_.toStdString(),
|
room_id_.toStdString(),
|
||||||
id.toStdString(),
|
id.toStdString(),
|
||||||
[this, id](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) {
|
||||||
|
QTimer::singleShot(err->matrix_error.retry_after, this, [this, id, reason]() {
|
||||||
|
this->redactEvent(id, reason);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
emit redactionFailed(tr("Message redaction failed: %1")
|
emit redactionFailed(tr("Message redaction failed: %1")
|
||||||
.arg(QString::fromStdString(err->matrix_error.error)));
|
.arg(QString::fromStdString(err->matrix_error.error)));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue