service/pam: add responseVisible

Fixes misunderstanding of "echo".
This commit is contained in:
outfoxxed 2024-06-19 00:31:09 -07:00
parent 6efa05a8eb
commit 59cf60d83e
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 22 additions and 18 deletions

View file

@ -46,6 +46,8 @@ class PamContext
///
/// Responses can be returned with the `respond()` function.
Q_PROPERTY(bool responseRequired READ isResponseRequired NOTIFY responseRequiredChanged);
/// If the user's response should be visible. Only valid when `responseRequired` is true.
Q_PROPERTY(bool responseVisible READ isResponseVisible NOTIFY responseVisibleChanged);
// clang-format on
QML_ELEMENT;
@ -84,6 +86,7 @@ public:
[[nodiscard]] QString message() const;
[[nodiscard]] bool messageIsError() const;
[[nodiscard]] bool isResponseRequired() const;
[[nodiscard]] bool isResponseVisible() const;
signals:
/// Emitted whenever authentication completes.
@ -104,11 +107,12 @@ signals:
void messageChanged();
void messageIsErrorChanged();
void responseRequiredChanged();
void responseVisibleChanged();
private slots:
void onCompleted(PamResult::Enum result);
void onError(PamError::Enum error);
void onMessage(QString message, bool messageChanged, bool isError, bool responseRequired);
void onMessage(QString message, bool isError, bool responseRequired, bool responseVisible);
private:
PamConversation* conversation = nullptr;
@ -121,4 +125,5 @@ private:
QString mMessage;
bool mMessageIsError = false;
bool mIsResponseRequired = false;
bool mIsResponseVisible = false;
};