diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index b0021283..f7c41706 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -112,6 +112,7 @@ class MatrixClient(nio.AsyncClient): async def request_user_update_event(self, user_id: str) -> None: if user_id in self.backend.pending_profile_requests: return + print(user_id) self.backend.pending_profile_requests.add(user_id) response = await self.get_profile(user_id) diff --git a/src/qml/Chat/Chat.qml b/src/qml/Chat/Chat.qml index 9b394000..a1a6bc46 100644 --- a/src/qml/Chat/Chat.qml +++ b/src/qml/Chat/Chat.qml @@ -68,70 +68,70 @@ HColumnLayout { } } -// RoomSidePane { - //id: roomSidePane + RoomSidePane { + id: roomSidePane - //activeView: roomHeader.activeButton - //property int oldWidth: width - //onActiveViewChanged: - //activeView ? restoreAnimation.start() : hideAnimation.start() + activeView: roomHeader.activeButton + property int oldWidth: width + onActiveViewChanged: + activeView ? restoreAnimation.start() : hideAnimation.start() - //HNumberAnimation { - //id: hideAnimation - //target: roomSidePane - //properties: "width" - //from: target.width - //to: 0 + HNumberAnimation { + id: hideAnimation + target: roomSidePane + properties: "width" + from: target.width + to: 0 - //onStarted: { - //target.oldWidth = target.width - //target.Layout.minimumWidth = 0 - //} - //} + onStarted: { + target.oldWidth = target.width + target.Layout.minimumWidth = 0 + } + } - //HNumberAnimation { - //id: restoreAnimation - //target: roomSidePane - //properties: "width" - //from: 0 - //to: target.oldWidth + HNumberAnimation { + id: restoreAnimation + target: roomSidePane + properties: "width" + from: 0 + to: target.oldWidth - //onStopped: target.Layout.minimumWidth = Qt.binding( - //function() { return theme.avatar.size } - //) - //} + onStopped: target.Layout.minimumWidth = Qt.binding( + function() { return theme.avatar.size } + ) + } - //collapsed: width < theme.avatar.size + 8 + collapsed: width < theme.avatar.size + 8 - //property bool wasSnapped: false - //property int referenceWidth: roomHeader.buttonsWidth - //onReferenceWidthChanged: { - //if (chatSplitView.canAutoSize || wasSnapped) { - //if (wasSnapped) { chatSplitView.canAutoSize = true } - //width = referenceWidth - //} - //} + property bool wasSnapped: false + property int referenceWidth: roomHeader.buttonsWidth + onReferenceWidthChanged: { + if (chatSplitView.canAutoSize || wasSnapped) { + if (wasSnapped) { chatSplitView.canAutoSize = true } + width = referenceWidth + } + } - //property int currentWidth: width - //onCurrentWidthChanged: { - //if (referenceWidth != width && - //referenceWidth - 15 < width && - //width < referenceWidth + 15) - //{ - //currentWidth = referenceWidth - //width = referenceWidth - //wasSnapped = true - //currentWidth = Qt.binding( - //function() { return roomSidePane.width } - //) - //} else { - //wasSnapped = false - //} - //} + property int currentWidth: width + onCurrentWidthChanged: { + if (referenceWidth != width && + referenceWidth - 15 < width && + width < referenceWidth + 15) + { + currentWidth = referenceWidth + width = referenceWidth + wasSnapped = true + currentWidth = Qt.binding( + function() { return roomSidePane.width } + ) + } else { + wasSnapped = false + } + } - //width: referenceWidth // Initial width - //Layout.minimumWidth: theme.avatar.size - //Layout.maximumWidth: parent.width - //} + width: referenceWidth // Initial width + Layout.minimumWidth: theme.avatar.size + Layout.maximumWidth: parent.width + } } } diff --git a/src/qml/Chat/RoomSidePane/MemberDelegate.qml b/src/qml/Chat/RoomSidePane/MemberDelegate.qml index 8bf2a4ea..15bb88b5 100644 --- a/src/qml/Chat/RoomSidePane/MemberDelegate.qml +++ b/src/qml/Chat/RoomSidePane/MemberDelegate.qml @@ -7,7 +7,7 @@ MouseArea { width: memberList.width height: childrenRect.height - property var memberInfo: Backend.users.get(model.userId) + property var memberInfo: users.getUser(model.userId) HRowLayout { width: parent.width @@ -15,7 +15,7 @@ MouseArea { HUserAvatar { id: avatar - userId: memberInfo.userId + userId: model.userId } HColumnLayout { diff --git a/src/qml/Chat/RoomSidePane/MembersView.qml b/src/qml/Chat/RoomSidePane/MembersView.qml index c54a0253..3e42a892 100644 --- a/src/qml/Chat/RoomSidePane/MembersView.qml +++ b/src/qml/Chat/RoomSidePane/MembersView.qml @@ -17,7 +17,7 @@ HColumnLayout { Layout.leftMargin: normalSpacing Layout.rightMargin: normalSpacing - model: chatPage.roomInfo.sortedMembers + model: chatPage.roomInfo.members delegate: MemberDelegate {} Layout.fillWidth: true @@ -32,14 +32,14 @@ HColumnLayout { // Without this, if the user types in the field, changes of room, then // comes back, the field will be empty but the filter still applied. - Component.onCompleted: - text = Backend.clients.get(chatPage.userId).getMemberFilter( - chatPage.category, chatPage.roomId - ) + //Component.onCompleted: + //text = Backend.clients.get(chatPage.userId).getMemberFilter( + //chatPage.category, chatPage.roomId + //) - onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter( - chatPage.category, chatPage.roomId, text - ) + //onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter( + //chatPage.category, chatPage.roomId, text + //) Layout.fillWidth: true Layout.preferredHeight: theme.bottomElementsHeight