Add "Leave room" option.

This commit is contained in:
Black Hat 2018-07-30 22:42:27 +08:00
parent c418c46f04
commit 22ad70cc49
2 changed files with 9 additions and 0 deletions

View File

@ -217,6 +217,10 @@ Item {
text: "Deprioritize" text: "Deprioritize"
onTriggered: roomListMenu.room.isLowPriority ? roomListMenu.room.removeTag("m.lowpriority") : roomListMenu.room.addTag("m.lowpriority", "1") onTriggered: roomListMenu.room.isLowPriority ? roomListMenu.room.removeTag("m.lowpriority") : roomListMenu.room.addTag("m.lowpriority", "1")
} }
MenuItem {
text: "Leave Room"
onTriggered: listModel.connection.forgetRoom(roomListMenu.room.id)
}
} }
} }
} }

View File

@ -9,6 +9,8 @@
#include "room.h" #include "room.h"
#include "roomlistmodel.h" #include "roomlistmodel.h"
#include "csapi/leaving.h"
using namespace QMatrixClient; using namespace QMatrixClient;
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -26,6 +28,9 @@ int main(int argc, char *argv[]) {
// QNetworkProxy::setApplicationProxy(proxy); // QNetworkProxy::setApplicationProxy(proxy);
qRegisterMetaType<Room *>("Room*"); qRegisterMetaType<Room *>("Room*");
qRegisterMetaType<LeaveRoomJob *>("LeaveRoomJob*");
qRegisterMetaType<ForgetRoomJob *>("ForgetRoomJob*");
qRegisterMetaType<User *>("User*"); qRegisterMetaType<User *>("User*");
qmlRegisterType<Controller>("Matrique", 0, 1, "Controller"); qmlRegisterType<Controller>("Matrique", 0, 1, "Controller");