diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-07-17 16:37:25 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-07-17 16:37:25 +0300 |
commit | 0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a (patch) | |
tree | 21f655d30630fe77ba48d07e4b357e2b6c6a5730 /src/MatrixClient.cpp | |
parent | Merge pull request #372 from bebehei/notification (diff) | |
download | nheko-0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a.tar.xz |
Move all files under src/
Diffstat (limited to 'src/MatrixClient.cpp')
-rw-r--r-- | src/MatrixClient.cpp | 38 |
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 |