diff --git a/include/libqmatrixclient b/include/libqmatrixclient index 716aa2a..cbb8c1b 160000 --- a/include/libqmatrixclient +++ b/include/libqmatrixclient @@ -1 +1 @@ -Subproject commit 716aa2a97d6654cc45ed6a9c8b08cad6d833e301 +Subproject commit cbb8c1bf4e33639d8a00341021542de99bd6bce2 diff --git a/qml/Room.qml b/qml/Room.qml index 6cffa7d..b82483b 100644 --- a/qml/Room.qml +++ b/qml/Room.qml @@ -13,7 +13,7 @@ Page { RoomListModel { id: roomListModel - connection: matriqueController.isLogin ? page.connection : undefined + connection: page.connection onNewMessage: trayIcon.showMessage("New message", "New message for room " + room.displayName) } diff --git a/qml/form/RoomListForm.qml b/qml/form/RoomListForm.qml index 828d125..1953fba 100644 --- a/qml/form/RoomListForm.qml +++ b/qml/form/RoomListForm.qml @@ -210,18 +210,12 @@ Item { id: roomListMenu MenuItem { - text: "Priorize" - onTriggered: { - roomListMenu.room.removeTag("m.lowpriority") - roomListMenu.room.addTag("m.favourite", "") - } + text: "Prioritize" + onTriggered: roomListMenu.room.isFavourite ? roomListMenu.room.removeTag("m.favourite") : roomListMenu.room.addTag("m.favourite", "1") } MenuItem { - text: "Depriorize" - onTriggered: { - roomListMenu.room.removeTag("m.favourite") - roomListMenu.room.addTag("m.lowpriority", "") - } + text: "Deprioritize" + onTriggered: roomListMenu.room.isLowPriority ? roomListMenu.room.removeTag("m.lowpriority") : roomListMenu.room.addTag("m.lowpriority", "1") } MenuItem { text: "Direct Chat" diff --git a/qml/form/SettingAccountForm.qml b/qml/form/SettingAccountForm.qml index fedb01a..ed6c2be 100644 --- a/qml/form/SettingAccountForm.qml +++ b/qml/form/SettingAccountForm.qml @@ -15,8 +15,8 @@ Page { Layout.preferredWidth: height Layout.fillHeight: true - source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" - displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N" + source: matriqueController.isLogin ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" + displayText: matriqueController.isLogin && connection.localUser.displayName ? connection.localUser.displayName : "N" opaqueBackground: false } @@ -26,12 +26,12 @@ Page { Label { font.pointSize: 18 - text: connection ? connection.localUser.displayName : "" + text: matriqueController.isLogin ? connection.localUser.displayName : "" } Label { font.pointSize: 12 - text: connection ? connection.localUser.id : "" + text: matriqueController.isLogin ? connection.localUser.id : "" } } } diff --git a/qml/main.qml b/qml/main.qml index c492f8b..6da07d6 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -153,8 +153,8 @@ ApplicationWindow { anchors.fill: parent anchors.margins: 15 - source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" - displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N" + source: matriqueController.isLogin ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png" + displayText: matriqueController.isLogin && connection.localUser.displayName ? connection.localUser.displayName : "N" opaqueBackground: false } diff --git a/src/roomlistmodel.cpp b/src/roomlistmodel.cpp index 1622bdb..0466067 100644 --- a/src/roomlistmodel.cpp +++ b/src/roomlistmodel.cpp @@ -57,6 +57,8 @@ void RoomListModel::connectRoomSignals(QMatrixClient::Room* room) { [=] { unreadMessagesChanged(room); }); connect(room, &QMatrixClient::Room::notificationCountChanged, this, [=] { unreadMessagesChanged(room); }); + connect(room, &QMatrixClient::Room::tagsChanged, this, + [=] { refresh(room); }); connect(room, &QMatrixClient::Room::joinStateChanged, this, [=] { refresh(room); }); connect(room, &QMatrixClient::Room::avatarChanged, this,