Skip to content

Commit

Permalink
Check via capabilities if server has Nextcloud Assistant enabled.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Apr 25, 2024
1 parent 7e801d6 commit 941ee72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libsync/capabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/libsync/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 941ee72

Please sign in to comment.