Use correct form of roomId

This commit is contained in:
Loren Burkholder 2021-09-07 20:38:39 -04:00
parent 87bff3493d
commit 96edc0bb75
3 changed files with 12 additions and 9 deletions

View file

@ -130,7 +130,7 @@ Page {
else else
return "image://colorimage/" + model.avatarUrl + "?" + communityItem.unimportantText; return "image://colorimage/" + model.avatarUrl + "?" + communityItem.unimportantText;
} }
roomid: model.roomid roomid: model.id
displayName: model.displayName displayName: model.displayName
color: communityItem.background color: communityItem.background
} }

View file

@ -137,7 +137,7 @@ Item {
ColumnLayout { ColumnLayout {
id: preview id: preview
property string roomid: room ? room.roomid : (roomPreview ? roomPreview.roomid : "") property string roomId: room ? room.roomId : (roomPreview ? roomPreview.roomId : "")
property string roomName: room ? room.roomName : (roomPreview ? roomPreview.roomName : "") property string roomName: room ? room.roomName : (roomPreview ? roomPreview.roomName : "")
property string roomTopic: room ? room.roomTopic : (roomPreview ? roomPreview.roomTopic : "") property string roomTopic: room ? room.roomTopic : (roomPreview ? roomPreview.roomTopic : "")
property string avatarUrl: room ? room.roomAvatarUrl : (roomPreview ? roomPreview.roomAvatarUrl : "") property string avatarUrl: room ? room.roomAvatarUrl : (roomPreview ? roomPreview.roomAvatarUrl : "")
@ -154,7 +154,7 @@ Item {
Avatar { Avatar {
url: parent.avatarUrl.replace("mxc://", "image://MxcImage/") url: parent.avatarUrl.replace("mxc://", "image://MxcImage/")
roomid: parent.roomid roomid: parent.roomId
displayName: parent.roomName displayName: parent.roomName
height: 130 height: 130
width: 130 width: 130

View file

@ -13,10 +13,13 @@ Rectangle {
property bool showBackButton: false property bool showBackButton: false
property string roomName: room ? room.roomName : qsTr("No room selected") property string roomName: room ? room.roomName : qsTr("No room selected")
property string roomId: room ? room.roomId : ""
property string avatarUrl: room ? room.roomAvatarUrl : "" property string avatarUrl: room ? room.roomAvatarUrl : ""
property string roomTopic: room ? room.roomTopic : "" property string roomTopic: room ? room.roomTopic : ""
property bool isEncrypted: room ? room.isEncrypted : false property bool isEncrypted: room ? room.isEncrypted : false
property int trustlevel: room ? room.trustlevel : Crypto.Unverified property int trustlevel: room ? room.trustlevel : Crypto.Unverified
property bool isDirect: room ? room.isDirect : false
property string directChatOtherUserId: room ? room.directChatOtherUserId : ""
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: topLayout.height + Nheko.paddingMedium * 2 implicitHeight: topLayout.height + Nheko.paddingMedium * 2
@ -65,12 +68,12 @@ Rectangle {
width: Nheko.avatarSize width: Nheko.avatarSize
height: Nheko.avatarSize height: Nheko.avatarSize
url: avatarUrl.replace("mxc://", "image://MxcImage/") url: avatarUrl.replace("mxc://", "image://MxcImage/")
roomid: room.roomId roomid: roomId
userid: room.isDirect ? room.directChatOtherUserId : "" userid: isDirect ? directChatOtherUserId : ""
displayName: roomName displayName: roomName
onClicked: { onClicked: {
if (room) if (room)
TimelineManager.openRoomSettings(room.roomId); TimelineManager.openRoomSettings(roomId);
} }
} }
@ -137,7 +140,7 @@ Rectangle {
Platform.MenuItem { Platform.MenuItem {
visible: room ? room.permissions.canInvite() : false visible: room ? room.permissions.canInvite() : false
text: qsTr("Invite users") text: qsTr("Invite users")
onTriggered: TimelineManager.openInviteUsers(room.roomId) onTriggered: TimelineManager.openInviteUsers(roomId)
} }
Platform.MenuItem { Platform.MenuItem {
@ -147,12 +150,12 @@ Rectangle {
Platform.MenuItem { Platform.MenuItem {
text: qsTr("Leave room") text: qsTr("Leave room")
onTriggered: TimelineManager.openLeaveRoomDialog(room.roomId) onTriggered: TimelineManager.openLeaveRoomDialog(roomId)
} }
Platform.MenuItem { Platform.MenuItem {
text: qsTr("Settings") text: qsTr("Settings")
onTriggered: TimelineManager.openRoomSettings(room.roomId) onTriggered: TimelineManager.openRoomSettings(roomId)
} }
} }