From 941ee7280f6266872059c61fff5e3a4bb3fc39e2 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Tue, 16 Apr 2024 18:24:11 +0200 Subject: [PATCH] Check via capabilities if server has Nextcloud Assistant enabled. Signed-off-by: Camila Ayres --- src/libsync/capabilities.cpp | 5 +++++ src/libsync/capabilities.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp index a189da2ac3fba..af178203eeb68 100644 --- a/src/libsync/capabilities.cpp +++ b/src/libsync/capabilities.cpp @@ -277,6 +277,11 @@ bool Capabilities::userStatusSupportsEmoji() const return userStatusMap.value("supports_emoji", false).toBool(); } +bool Capabilities::ncAssistantEnabled() const +{ + return _capabilities["assistant"].toMap()["enabled"].toBool(); +} + QColor Capabilities::serverColor() const { const auto themingMap = serverThemingMap(); diff --git a/src/libsync/capabilities.h b/src/libsync/capabilities.h index 1dd0514a28f69..110b507751600 100644 --- a/src/libsync/capabilities.h +++ b/src/libsync/capabilities.h @@ -69,6 +69,7 @@ class OWNCLOUDSYNC_EXPORT Capabilities [[nodiscard]] bool filesLockTypeAvailable() const; [[nodiscard]] bool userStatus() const; [[nodiscard]] bool userStatusSupportsEmoji() const; + [[nodiscard]] bool ncAssistantEnabled() const; [[nodiscard]] QColor serverColor() const; [[nodiscard]] QColor serverTextColor() const;