Fix showing Location events

- Initialize required properties
- Use event's body as display
This commit is contained in:
Tobias Fella
2025-08-29 18:00:44 +02:00
committed by Tobias Fella
parent 9b65ae1e66
commit 62a770b3e2
2 changed files with 5 additions and 1 deletions

View File

@@ -41,6 +41,8 @@ ColumnLayout {
*/
required property var componentAttributes
required property int index
Layout.fillWidth: true
Layout.maximumWidth: Message.maxContentWidth
@@ -124,5 +126,7 @@ ColumnLayout {
author: root.author
display: root.display
visible: root.display !== ""
index: root.index
componentAttributes: root.componentAttributes
}
}

View File

@@ -448,7 +448,7 @@ QList<MessageComponent> EventMessageContentModel::componentsForType(MessageCompo
}
case MessageComponentType::Location:
return {MessageComponent{type,
QString(),
EventHandler::plainBody(m_room, event.first),
{
{u"latitude"_s, EventHandler::latitude(event.first)},
{u"longitude"_s, EventHandler::longitude(event.first)},