Link Previewer MXC Links
- Update link preview to get valid mxc links. - Get the connection from a room.
This commit is contained in:
@@ -13,6 +13,11 @@ import org.kde.neochat 1.0
|
||||
Loader {
|
||||
id: root
|
||||
|
||||
/**
|
||||
* @brief The room that the component is created in.
|
||||
*/
|
||||
property var room
|
||||
|
||||
/**
|
||||
* @brief Get a list of hyperlinks in the text.
|
||||
*
|
||||
@@ -33,6 +38,7 @@ Loader {
|
||||
}
|
||||
LinkPreviewer {
|
||||
id: linkPreviewer
|
||||
room: root.room
|
||||
url: root.links && root.links.length > 0 ? root.links[0] : ""
|
||||
}
|
||||
|
||||
@@ -76,7 +82,7 @@ Loader {
|
||||
visible: linkPreviewer.imageSource
|
||||
Layout.maximumHeight: root.defaultHeight
|
||||
Layout.maximumWidth: root.defaultHeight
|
||||
source: linkPreviewer.imageSource.replace("mxc://", "image://mxc/")
|
||||
source: linkPreviewer.imageSource
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
ColumnLayout {
|
||||
|
||||
@@ -35,6 +35,7 @@ TimelineContainer {
|
||||
}
|
||||
LinkPreviewDelegate {
|
||||
Layout.fillWidth: true
|
||||
room: currentRoom
|
||||
indicatorEnabled: messageDelegate.isVisibleInTimeline()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user