summary refs log tree commit diff
path: root/src/MatrixClient.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
commit0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a (patch)
tree21f655d30630fe77ba48d07e4b357e2b6c6a5730 /src/MatrixClient.cpp
parentMerge pull request #372 from bebehei/notification (diff)
downloadnheko-0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a.tar.xz
Move all files under src/
Diffstat (limited to 'src/MatrixClient.cpp')
-rw-r--r--src/MatrixClient.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/MatrixClient.cpp b/src/MatrixClient.cpp
new file mode 100644
index 00000000..e41c66c1
--- /dev/null
+++ b/src/MatrixClient.cpp
@@ -0,0 +1,38 @@
+#include "MatrixClient.h"
+
+#include <memory>
+
+namespace {
+auto client_ = std::make_shared<mtx::http::Client>();
+}
+
+namespace http {
+
+mtx::http::Client *
+client()
+{
+        return client_.get();
+}
+
+bool
+is_logged_in()
+{
+        return !client_->access_token().empty();
+}
+
+void
+init()
+{
+        qRegisterMetaType<mtx::responses::Login>();
+        qRegisterMetaType<mtx::responses::Messages>();
+        qRegisterMetaType<mtx::responses::Notifications>();
+        qRegisterMetaType<mtx::responses::Rooms>();
+        qRegisterMetaType<mtx::responses::Sync>();
+        qRegisterMetaType<mtx::responses::JoinedGroups>();
+        qRegisterMetaType<mtx::responses::GroupProfile>();
+        qRegisterMetaType<std::string>();
+        qRegisterMetaType<std::vector<std::string>>();
+        qRegisterMetaType<std::vector<QString>>();
+}
+
+} // namespace http