summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-11-29 06:06:51 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-11-29 06:06:51 +0100
commit6779f0e509e96cf6938d268036aaf622e70761eb (patch)
treebc59417949c7e122f878ccd3d9537e70b4614c10 /src
parentRemove double padding on redactions (diff)
downloadnheko-6779f0e509e96cf6938d268036aaf622e70761eb.tar.xz
Delete rooms even if we fail to leave
Diffstat (limited to 'src')
-rw-r--r--src/ChatPage.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp

index c1c7eb7d..a05bbeb1 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp
@@ -754,6 +754,16 @@ ChatPage::leaveRoom(const QString &room_id) if (err) { emit showNotification(tr("Failed to leave room: %1") .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; }