aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-13 20:28:56 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-13 20:28:56 +0900
commitfadce11be92abe76cecfe6356b3b38f25dd93e8d (patch)
tree4bbe8263daeec7cd5ac3ff1366cdb23c03aab8d9 /lib/jobs
parent18cb395868f448a34dacd55a0b7b5c5eb9f06e27 (diff)
downloadlibquotient-fadce11be92abe76cecfe6356b3b38f25dd93e8d.tar.gz
libquotient-fadce11be92abe76cecfe6356b3b38f25dd93e8d.zip
Support for server notices rooms (MSC1452)
Closes #326.
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/basejob.cpp3
-rw-r--r--lib/jobs/basejob.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index ec6b8375..5930e8b8 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -426,6 +426,9 @@ BaseJob::Status BaseJob::parseError(QNetworkReply* reply,
? tr("Requested room version: %1")
.arg(errorJson.value("room_version"_ls).toString())
: errorJson.value("error"_ls).toString() };
+ if (errCode == "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM")
+ return { CannotLeaveRoom,
+ tr("It's not allowed to leave a server notices room") };
// Not localisable on the client side
if (errorJson.contains("error"_ls))
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h
index 90c20c37..68467d48 100644
--- a/lib/jobs/basejob.h
+++ b/lib/jobs/basejob.h
@@ -76,6 +76,7 @@ public:
NetworkAuthRequiredError = NetworkAuthRequired,
UserConsentRequired,
UserConsentRequiredError = UserConsentRequired,
+ CannotLeaveRoom,
UserDefinedError = 256
};