Update libqmatrixclient.

This update brings some changes, and more debugging is needed.
This commit is contained in:
Black Hat
2018-08-03 17:27:21 +08:00
parent 6550f2411a
commit 3e9a12e4cb
5 changed files with 13 additions and 7 deletions

View File

@@ -73,6 +73,12 @@ void Controller::reconnect() {
m_connection->connectWithToken(userID, token, "");
}
void Controller::postMessage(Room* room, const QString& type,
const QString& text) {
room->postMessage("m.room.message",
QJsonObject{{"msgtype", type}, {"body", text}});
}
void Controller::postFile(Room* room, const QUrl& localFile,
const QUrl& mxcUrl) {
const QString mime = getMIME(localFile);

View File

@@ -95,6 +95,7 @@ class Controller : public QObject {
void errorOccured();
public slots:
void postMessage(Room* room, const QString& type, const QString& text);
void postFile(Room* room, const QUrl& localFile, const QUrl& mxcUrl);
QString getMIME(const QUrl& fileUrl) const;
void forgetRoom(const QString& roomID);

View File

@@ -22,7 +22,6 @@ int main(int argc, char *argv[]) {
QApplication app(argc, argv);
qRegisterMetaType<Room *>("Room*");
qRegisterMetaType<User *>("User*");
qmlRegisterType<Controller>("Matrique", 0, 1, "Controller");