summaryrefslogtreecommitdiff
path: root/login.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-02-04 11:34:38 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-04 15:24:48 +0100
commit23cc4be5bc02328fe73ccbd67493dd71ef2e2b8f (patch)
treeb9e1a7a416f004d96671c0abf597524946b9dda3 /login.h
parent3b9973552ec613b37fb511f3a0ae24dacb1e4366 (diff)
downloadyachat6-23cc4be5bc02328fe73ccbd67493dd71ef2e2b8f.tar.gz
Add accounts and login pages
Diffstat (limited to 'login.h')
-rw-r--r--login.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/login.h b/login.h
new file mode 100644
index 0000000..ca291d5
--- /dev/null
+++ b/login.h
@@ -0,0 +1,30 @@
+#ifndef LOGIN_H
+#define LOGIN_H
+
+#include "client.h"
+#include <QQmlApplicationEngine>
+#include <QObject>
+#include <QString>
+
+class Login : public QObject
+{
+ Q_OBJECT
+ QML_ELEMENT
+
+public:
+ Login(QObject *parent = nullptr);
+ Q_INVOKABLE void start(QString jid, QString pwd);
+
+Q_SIGNALS:
+ void authSuccess(Client *c);
+ void close();
+ void error(QString error);
+
+private:
+ void setup(const QString &jid, const QString pwd, const QString &domain);
+ static QString error_to_str(const QXmppStanza::Error::Condition c);
+ static bool jid_is_valid(const QString &jid, QString &domain);
+};
+
+
+#endif