diff --git a/imports/NeoChat/Component/ChatBox/ChatBar.qml b/imports/NeoChat/Component/ChatBox/ChatBar.qml index 2b469bd4b..f2a56988d 100644 --- a/imports/NeoChat/Component/ChatBox/ChatBar.qml +++ b/imports/NeoChat/Component/ChatBox/ChatBar.qml @@ -94,11 +94,11 @@ ToolBar { //property int lineHeight: contentHeight / lineCount text: inputFieldText - placeholderText: currentRoom.usesEncryption ? i18n("This room is encrypted. Sending encrypted messages is not yet supported.") : editEventId.length > 0 ? i18n("Edit Message") : i18n("Write your message...") + placeholderText: readOnly ? i18n("This room is encrypted. Sending encrypted messages is not yet supported.") : editEventId.length > 0 ? i18n("Edit Message") : currentRoom.usesEncryption ? i18n("Send an encrypted message…") : i18n("Send a message…") verticalAlignment: TextEdit.AlignVCenter horizontalAlignment: TextEdit.AlignLeft wrapMode: Text.Wrap - readOnly: currentRoom.usesEncryption + readOnly: currentRoom.usesEncryption && !Controller.encryptionSupported Kirigami.Theme.colorSet: Kirigami.Theme.View Kirigami.Theme.inherit: false diff --git a/src/controller.cpp b/src/controller.cpp index f4e26fa54..1ba7916e2 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -706,4 +706,13 @@ bool Controller::hasWindowSystem() const QString Controller::plainText(QQuickTextDocument *document) const { return document->textDocument()->toPlainText(); -} \ No newline at end of file +} + +bool Controller::encryptionSupported() const +{ +#ifdef QUOTIENT_07 + return Quotient::encryptionSupported(); +#else + return false; +#endif +} diff --git a/src/controller.h b/src/controller.h index 3a51f22ab..e846abcf0 100644 --- a/src/controller.h +++ b/src/controller.h @@ -41,6 +41,7 @@ class Controller : public QObject Q_PROPERTY(bool supportSystemTray READ supportSystemTray CONSTANT) Q_PROPERTY(bool hasWindowSystem READ hasWindowSystem CONSTANT) Q_PROPERTY(bool isOnline READ isOnline NOTIFY isOnlineChanged) + Q_PROPERTY(bool encryptionSupported READ encryptionSupported CONSTANT) public: static Controller &instance(); @@ -96,6 +97,7 @@ public: Q_INVOKABLE void setBlur(QQuickItem *item, bool blur); Q_INVOKABLE void raiseWindow(QWindow *window); Q_INVOKABLE QString plainText(QQuickTextDocument *document) const; + bool encryptionSupported() const; private: explicit Controller(QObject *parent = nullptr);