Skip to content
Snippets Groups Projects
Verified Commit 6779f0e5 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Delete rooms even if we fail to leave

parent a703e6f0
No related branches found
No related tags found
No related merge requests found
Pipeline #2184 passed
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment