From 2f65cbeb36a7adb07ede29d47d673149f1212bb6 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Tue, 27 Jun 2023 18:39:08 +0200 Subject: [PATCH] Show location descriptions in the timeline when available --- src/neochatroom.cpp | 3 +++ src/qml/Component/Timeline/LiveLocationDelegate.qml | 5 +++++ src/qml/Component/Timeline/LocationDelegate.qml | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index df12edb18..79a1b5054 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -696,6 +696,9 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format, } return i18nc("[User] configured widget", "configured %1 widget", e.contentJson()["name"].toString()); } + if (e.matrixType() == "org.matrix.msc3672.beacon_info"_ls) { + return e.contentJson()["description"_ls].toString(); + } return e.stateKey().isEmpty() ? i18n("updated %1 state", e.matrixType()) : i18n("updated %1 state for %2", e.matrixType(), e.stateKey().toHtmlEscaped()); }, diff --git a/src/qml/Component/Timeline/LiveLocationDelegate.qml b/src/qml/Component/Timeline/LiveLocationDelegate.qml index 5d96c7fed..06ded9cf1 100644 --- a/src/qml/Component/Timeline/LiveLocationDelegate.qml +++ b/src/qml/Component/Timeline/LiveLocationDelegate.qml @@ -62,5 +62,10 @@ TimelineContainer { id: fullScreenMap FullScreenMap {} } + + RichLabel { + textMessage: root.display + visible: root.display !== "" + } } } diff --git a/src/qml/Component/Timeline/LocationDelegate.qml b/src/qml/Component/Timeline/LocationDelegate.qml index 1d3ff6c2f..9939625cc 100644 --- a/src/qml/Component/Timeline/LocationDelegate.qml +++ b/src/qml/Component/Timeline/LocationDelegate.qml @@ -76,5 +76,10 @@ TimelineContainer { id: fullScreenMap FullScreenMap { } } + + RichLabel { + textMessage: root.display + visible: root.display !== "" + } } }