Update libqmatrixclient && add prioritize/deprioritize.

This commit is contained in:
Black Hat 2018-07-23 22:41:18 +08:00
parent be5332770a
commit 845b0114bd
6 changed files with 14 additions and 18 deletions

@ -1 +1 @@
Subproject commit 716aa2a97d6654cc45ed6a9c8b08cad6d833e301 Subproject commit cbb8c1bf4e33639d8a00341021542de99bd6bce2

View File

@ -13,7 +13,7 @@ Page {
RoomListModel { RoomListModel {
id: roomListModel id: roomListModel
connection: matriqueController.isLogin ? page.connection : undefined connection: page.connection
onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName) onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName)
} }

View File

@ -210,18 +210,12 @@ Item {
id: roomListMenu id: roomListMenu
MenuItem { MenuItem {
text: "Priorize" text: "Prioritize"
onTriggered: { onTriggered: roomListMenu.room.isFavourite ? roomListMenu.room.removeTag("m.favourite") : roomListMenu.room.addTag("m.favourite", "1")
roomListMenu.room.removeTag("m.lowpriority")
roomListMenu.room.addTag("m.favourite", "")
}
} }
MenuItem { MenuItem {
text: "Depriorize" text: "Deprioritize"
onTriggered: { onTriggered: roomListMenu.room.isLowPriority ? roomListMenu.room.removeTag("m.lowpriority") : roomListMenu.room.addTag("m.lowpriority", "1")
roomListMenu.room.removeTag("m.favourite")
roomListMenu.room.addTag("m.lowpriority", "")
}
} }
MenuItem { MenuItem {
text: "Direct Chat" text: "Direct Chat"

View File

@ -15,8 +15,8 @@ Page {
Layout.preferredWidth: height Layout.preferredWidth: height
Layout.fillHeight: true Layout.fillHeight: true
source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" source: matriqueController.isLogin ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N" displayText: matriqueController.isLogin && connection.localUser.displayName ? connection.localUser.displayName : "N"
opaqueBackground: false opaqueBackground: false
} }
@ -26,12 +26,12 @@ Page {
Label { Label {
font.pointSize: 18 font.pointSize: 18
text: connection ? connection.localUser.displayName : "" text: matriqueController.isLogin ? connection.localUser.displayName : ""
} }
Label { Label {
font.pointSize: 12 font.pointSize: 12
text: connection ? connection.localUser.id : "" text: matriqueController.isLogin ? connection.localUser.id : ""
} }
} }
} }

View File

@ -153,8 +153,8 @@ ApplicationWindow {
anchors.fill: parent anchors.fill: parent
anchors.margins: 15 anchors.margins: 15
source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" source: matriqueController.isLogin ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N" displayText: matriqueController.isLogin && connection.localUser.displayName ? connection.localUser.displayName : "N"
opaqueBackground: false opaqueBackground: false
} }

View File

@ -57,6 +57,8 @@ void RoomListModel::connectRoomSignals(QMatrixClient::Room* room) {
[=] { unreadMessagesChanged(room); }); [=] { unreadMessagesChanged(room); });
connect(room, &QMatrixClient::Room::notificationCountChanged, this, connect(room, &QMatrixClient::Room::notificationCountChanged, this,
[=] { unreadMessagesChanged(room); }); [=] { unreadMessagesChanged(room); });
connect(room, &QMatrixClient::Room::tagsChanged, this,
[=] { refresh(room); });
connect(room, &QMatrixClient::Room::joinStateChanged, this, connect(room, &QMatrixClient::Room::joinStateChanged, this,
[=] { refresh(room); }); [=] { refresh(room); });
connect(room, &QMatrixClient::Room::avatarChanged, this, connect(room, &QMatrixClient::Room::avatarChanged, this,