aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/connection.cpp8
-rw-r--r--lib/connection.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index d773f0d8..579c7920 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -1745,6 +1745,14 @@ QStringList Connection::stableRoomVersions() const
return l;
}
+bool Connection::canChangePassword() const
+{
+ // By default assume we can
+ return d->capabilities.changePassword
+ ? d->capabilities.changePassword->enabled
+ : true;
+}
+
inline bool roomVersionLess(const Connection::SupportedRoomVersion& v1,
const Connection::SupportedRoomVersion& v2)
{
diff --git a/lib/connection.h b/lib/connection.h
index 4f949641..0d22d01f 100644
--- a/lib/connection.h
+++ b/lib/connection.h
@@ -354,6 +354,11 @@ public:
* \sa loadingCapabilities */
QVector<SupportedRoomVersion> availableRoomVersions() const;
+ /// Indicate if the user can change its password from the client.
+ /// This is often not the case when SSO is enabled.
+ /// \sa loadingCapabilities
+ bool canChangePassword() const;
+
/**
* Call this before first sync to load from previously saved file.
*