diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml
index ab067eee..5d2b583a 100644
--- a/resources/qml/Avatar.qml
+++ b/resources/qml/Avatar.qml
@@ -12,6 +12,7 @@ Rectangle {
property string url
property string userid
+ property string roomid
property string displayName
property alias textColor: label.color
property bool crop: true
@@ -35,11 +36,29 @@ Rectangle {
font.pixelSize: avatar.height / 2
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
- visible: img.status != Image.Ready
+ visible: img.status != Image.Ready && !Settings.useIdenticon
color: Nheko.colors.text
}
Image {
+ id: identicon
+ anchors.fill: parent
+ visible: Settings.useIdenticon && img.status != Image.Ready
+ source: Settings.useIdenticon ? ("image://jdenticon/" + (userid !== "" ? userid : roomid) + "?radius=" + (Settings.avatarCircles ? 100 : 25)) : ""
+
+ MouseArea {
+ anchors.fill: parent
+
+ Ripple {
+ rippleTarget: parent
+ color: Qt.rgba(Nheko.colors.alternateBase.r, Nheko.colors.alternateBase.g, Nheko.colors.alternateBase.b, 0.5)
+ }
+
+ }
+
+ }
+
+ Image {
id: img
anchors.fill: parent
diff --git a/resources/qml/CommunitiesList.qml b/resources/qml/CommunitiesList.qml
index 491913be..ff9b7da7 100644
--- a/resources/qml/CommunitiesList.qml
+++ b/resources/qml/CommunitiesList.qml
@@ -130,6 +130,7 @@ Page {
else
return "image://colorimage/" + model.avatarUrl + "?" + communityItem.unimportantText;
}
+ roomid: model.id
displayName: model.displayName
color: communityItem.background
}
diff --git a/resources/qml/Completer.qml b/resources/qml/Completer.qml
index 00fc3216..6bde67fa 100644
--- a/resources/qml/Completer.qml
+++ b/resources/qml/Completer.qml
@@ -139,6 +139,7 @@ Popup {
height: popup.avatarHeight
width: popup.avatarWidth
displayName: model.displayName
+ userid: model.userid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
onClicked: popup.completionClicked(completer.completionAt(model.index))
}
@@ -194,6 +195,7 @@ Popup {
height: popup.avatarHeight
width: popup.avatarWidth
displayName: model.roomName
+ roomid: model.roomid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
onClicked: {
popup.completionClicked(completer.completionAt(model.index));
@@ -225,6 +227,7 @@ Popup {
height: popup.avatarHeight
width: popup.avatarWidth
displayName: model.roomName
+ roomid: model.roomid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
onClicked: popup.completionClicked(completer.completionAt(model.index))
}
diff --git a/resources/qml/RoomDirectory.qml b/resources/qml/RoomDirectory.qml
index 2d7b3a34..b51c7bbc 100644
--- a/resources/qml/RoomDirectory.qml
+++ b/resources/qml/RoomDirectory.qml
@@ -65,6 +65,7 @@ ApplicationWindow {
width: avatarSize
height: avatarSize
url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
+ roomid: model.roomid
displayName: model.name
}
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index a0009174..addbf571 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -143,6 +143,8 @@ Page {
required property int notificationCount
required property bool hasLoudNotification
required property bool hasUnreadMessages
+ required property bool isDirect
+ required property string directChatOtherUserId
color: background
height: avatarSize + 2 * Nheko.paddingMedium
@@ -237,6 +239,8 @@ Page {
width: avatarSize
url: avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: roomName
+ userid: isDirect ? directChatOtherUserId : ""
+ roomid: roomId
Rectangle {
id: collapsedNotificationBubble
diff --git a/resources/qml/RoomMembers.qml b/resources/qml/RoomMembers.qml
index 62175bf0..3376a4b6 100644
--- a/resources/qml/RoomMembers.qml
+++ b/resources/qml/RoomMembers.qml
@@ -39,6 +39,7 @@ ApplicationWindow {
width: 130
height: width
+ roomid: members.roomId
displayName: members.roomName
Layout.alignment: Qt.AlignHCenter
url: members.avatarUrl.replace("mxc://", "image://MxcImage/")
diff --git a/resources/qml/RoomSettings.qml b/resources/qml/RoomSettings.qml
index a70cd71a..152567c8 100644
--- a/resources/qml/RoomSettings.qml
+++ b/resources/qml/RoomSettings.qml
@@ -38,6 +38,7 @@ ApplicationWindow {
Avatar {
url: roomSettings.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
+ roomid: roomSettings.roomid
displayName: roomSettings.roomName
height: 130
width: 130
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index f12060f2..91bbca5b 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -137,6 +137,7 @@ Item {
ColumnLayout {
id: preview
+ property string roomId: room ? room.roomId : (roomPreview ? roomPreview.roomId : "")
property string roomName: room ? room.roomName : (roomPreview ? roomPreview.roomName : "")
property string roomTopic: room ? room.roomTopic : (roomPreview ? roomPreview.roomTopic : "")
property string avatarUrl: room ? room.roomAvatarUrl : (roomPreview ? roomPreview.roomAvatarUrl : "")
@@ -153,6 +154,7 @@ Item {
Avatar {
url: parent.avatarUrl.replace("mxc://", "image://MxcImage/")
+ roomid: parent.roomId
displayName: parent.roomName
height: 130
width: 130
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index 7f67c028..05c61d99 100644
--- a/resources/qml/TopBar.qml
+++ b/resources/qml/TopBar.qml
@@ -13,10 +13,13 @@ Rectangle {
property bool showBackButton: false
property string roomName: room ? room.roomName : qsTr("No room selected")
+ property string roomId: room ? room.roomId : ""
property string avatarUrl: room ? room.roomAvatarUrl : ""
property string roomTopic: room ? room.roomTopic : ""
property bool isEncrypted: room ? room.isEncrypted : false
property int trustlevel: room ? room.trustlevel : Crypto.Unverified
+ property bool isDirect: room ? room.isDirect : false
+ property string directChatOtherUserId: room ? room.directChatOtherUserId : ""
Layout.fillWidth: true
implicitHeight: topLayout.height + Nheko.paddingMedium * 2
@@ -65,10 +68,12 @@ Rectangle {
width: Nheko.avatarSize
height: Nheko.avatarSize
url: avatarUrl.replace("mxc://", "image://MxcImage/")
+ roomid: roomId
+ userid: isDirect ? directChatOtherUserId : ""
displayName: roomName
onClicked: {
if (room)
- TimelineManager.openRoomSettings(room.roomId);
+ TimelineManager.openRoomSettings(roomId);
}
}
@@ -135,7 +140,7 @@ Rectangle {
Platform.MenuItem {
visible: room ? room.permissions.canInvite() : false
text: qsTr("Invite users")
- onTriggered: TimelineManager.openInviteUsers(room.roomId)
+ onTriggered: TimelineManager.openInviteUsers(roomId)
}
Platform.MenuItem {
@@ -145,12 +150,12 @@ Rectangle {
Platform.MenuItem {
text: qsTr("Leave room")
- onTriggered: TimelineManager.openLeaveRoomDialog(room.roomId)
+ onTriggered: TimelineManager.openLeaveRoomDialog(roomId)
}
Platform.MenuItem {
text: qsTr("Settings")
- onTriggered: TimelineManager.openRoomSettings(room.roomId)
+ onTriggered: TimelineManager.openRoomSettings(roomId)
}
}
diff --git a/resources/qml/components/AvatarListTile.qml b/resources/qml/components/AvatarListTile.qml
index 36c26a97..853266c6 100644
--- a/resources/qml/components/AvatarListTile.qml
+++ b/resources/qml/components/AvatarListTile.qml
@@ -23,6 +23,8 @@ Rectangle {
required property int index
required property int selectedIndex
property bool crop: true
+ property alias roomid: avatar.roomid
+ property alias userid: avatar.userid
color: background
height: avatarSize + 2 * Nheko.paddingMedium
diff --git a/resources/qml/dialogs/ImagePackEditorDialog.qml b/resources/qml/dialogs/ImagePackEditorDialog.qml
index e78213e0..c028f4a2 100644
--- a/resources/qml/dialogs/ImagePackEditorDialog.qml
+++ b/resources/qml/dialogs/ImagePackEditorDialog.qml
@@ -61,6 +61,7 @@ ApplicationWindow {
header: AvatarListTile {
title: imagePack.packname
avatarUrl: imagePack.avatarUrl
+ roomid: imagePack.statekey
subtitle: imagePack.statekey
index: -1
selectedIndex: currentImageIndex
@@ -142,6 +143,7 @@ ApplicationWindow {
Layout.columnSpan: 2
url: imagePack.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: imagePack.packname
+ roomid: imagePack.statekey
height: 130
width: 130
crop: false
@@ -219,6 +221,7 @@ ApplicationWindow {
Layout.columnSpan: 2
url: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.Url).replace("mxc://", "image://MxcImage/")
displayName: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.ShortCode)
+ roomid: displayName
height: 130
width: 130
crop: false
diff --git a/resources/qml/dialogs/ImagePackSettingsDialog.qml b/resources/qml/dialogs/ImagePackSettingsDialog.qml
index b217abdd..ca09ff27 100644
--- a/resources/qml/dialogs/ImagePackSettingsDialog.qml
+++ b/resources/qml/dialogs/ImagePackSettingsDialog.qml
@@ -112,6 +112,7 @@ ApplicationWindow {
return qsTr("Globally enabled pack");
}
selectedIndex: currentPackIndex
+ roomid: currentPack.statekey
TapHandler {
onSingleTapped: currentPackIndex = index
@@ -135,6 +136,7 @@ ApplicationWindow {
property string packName: currentPack ? currentPack.packname : ""
property string attribution: currentPack ? currentPack.attribution : ""
property string avatarUrl: currentPack ? currentPack.avatarUrl : ""
+ property string statekey: currentPack ? currentPack.statekey : ""
anchors.fill: parent
anchors.margins: Nheko.paddingLarge
@@ -143,6 +145,7 @@ ApplicationWindow {
Avatar {
url: packinfo.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: packinfo.packName
+ roomid: packinfo.statekey
height: 100
width: 100
Layout.alignment: Qt.AlignHCenter
diff --git a/resources/qml/voip/ActiveCallBar.qml b/resources/qml/voip/ActiveCallBar.qml
index d44c5edf..be698356 100644
--- a/resources/qml/voip/ActiveCallBar.qml
+++ b/resources/qml/voip/ActiveCallBar.qml
@@ -34,14 +34,15 @@ Rectangle {
width: Nheko.avatarSize
height: Nheko.avatarSize
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
- displayName: CallManager.callParty
+ userid: CallManager.callParty
+ displayName: CallManager.callPartyDisplayName
onClicked: TimelineManager.openImageOverlay(room.avatarUrl(userid), room.data.eventId)
}
Label {
Layout.leftMargin: 8
font.pointSize: fontMetrics.font.pointSize * 1.1
- text: CallManager.callParty
+ text: CallManager.callPartyDisplayName
color: "#000000"
}
diff --git a/resources/qml/voip/CallInvite.qml b/resources/qml/voip/CallInvite.qml
index 253fa25c..1bd5eb26 100644
--- a/resources/qml/voip/CallInvite.qml
+++ b/resources/qml/voip/CallInvite.qml
@@ -40,7 +40,7 @@ Popup {
Label {
Layout.alignment: Qt.AlignCenter
Layout.topMargin: msgView.height / 25
- text: CallManager.callParty
+ text: CallManager.callPartyDisplayName
font.pointSize: fontMetrics.font.pointSize * 2
color: Nheko.colors.windowText
}
@@ -50,7 +50,8 @@ Popup {
width: msgView.height / 5
height: msgView.height / 5
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
- displayName: CallManager.callParty
+ userid: CallManager.callParty
+ displayName: CallManager.callPartyDisplayName
}
ColumnLayout {
diff --git a/resources/qml/voip/CallInviteBar.qml b/resources/qml/voip/CallInviteBar.qml
index f6c1ecde..10f8367a 100644
--- a/resources/qml/voip/CallInviteBar.qml
+++ b/resources/qml/voip/CallInviteBar.qml
@@ -41,14 +41,15 @@ Rectangle {
width: Nheko.avatarSize
height: Nheko.avatarSize
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
- displayName: CallManager.callParty
+ userid: CallManager.callParty
+ displayName: CallManager.callPartyDisplayName
onClicked: TimelineManager.openImageOverlay(room.avatarUrl(userid), room.data.eventId)
}
Label {
Layout.leftMargin: 8
font.pointSize: fontMetrics.font.pointSize * 1.1
- text: CallManager.callParty
+ text: CallManager.callPartyDisplayName
color: "#000000"
}
diff --git a/resources/qml/voip/PlaceCall.qml b/resources/qml/voip/PlaceCall.qml
index 97932cc9..c733012c 100644
--- a/resources/qml/voip/PlaceCall.qml
+++ b/resources/qml/voip/PlaceCall.qml
@@ -79,6 +79,7 @@ Popup {
height: Nheko.avatarSize
url: room.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: room.roomName
+ roomid: room.roomid
onClicked: TimelineManager.openImageOverlay(room.avatarUrl(userid), room.data.eventId)
}
|