mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Delete rooms even if we fail to leave
This commit is contained in:
parent
a703e6f041
commit
6779f0e509
1 changed files with 10 additions and 0 deletions
|
@ -754,6 +754,16 @@ ChatPage::leaveRoom(const QString &room_id)
|
||||||
if (err) {
|
if (err) {
|
||||||
emit showNotification(tr("Failed to leave room: %1")
|
emit showNotification(tr("Failed to leave room: %1")
|
||||||
.arg(QString::fromStdString(err->matrix_error.error)));
|
.arg(QString::fromStdString(err->matrix_error.error)));
|
||||||
|
nhlog::net()->error("Failed to leave room '{}': {}", room_id.toStdString(), err);
|
||||||
|
|
||||||
|
if (err->status_code == 404 &&
|
||||||
|
err->matrix_error.errcode == mtx::errors::ErrorCode::M_UNKNOWN) {
|
||||||
|
nhlog::db()->debug(
|
||||||
|
"Removing invite and room for {}, even though we couldn't leave.",
|
||||||
|
room_id.toStdString());
|
||||||
|
cache::client()->removeInvite(room_id.toStdString());
|
||||||
|
cache::client()->removeRoom(room_id.toStdString());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue