From 1f723d1fdf06d5e4ce7b9b2d5a18509e931b4962 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 12 Feb 2026 18:24:28 +0000 Subject: [PATCH] Allow replying to messages within a thread --- .../models/eventmessagecontentmodel.cpp | 6 +++--- src/timeline/Bubble.qml | 2 +- src/timeline/DelegateContextMenu.qml | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/messagecontent/models/eventmessagecontentmodel.cpp b/src/messagecontent/models/eventmessagecontentmodel.cpp index af92541eb..a6e273452 100644 --- a/src/messagecontent/models/eventmessagecontentmodel.cpp +++ b/src/messagecontent/models/eventmessagecontentmodel.cpp @@ -113,8 +113,8 @@ void EventMessageContentModel::initializeModel() } }); #if Quotient_VERSION_MINOR > 9 - connect(m_room, &Room::newThread, this, [this](const auto &newThread) { - if (newThread == m_eventId) { + connect(m_room, &Room::newThread, this, [this](const Thread &newThread) { + if (newThread.threadRootId == m_eventId) { resetContent(); } }); @@ -324,7 +324,7 @@ void EventMessageContentModel::updateReplyModel() if (roomMessageEvent == nullptr) { return; } - if (!roomMessageEvent->isReply(m_threadsEnabled) || (roomMessageEvent->isThreaded() && m_threadsEnabled)) { + if (!roomMessageEvent->isReply(!m_threadsEnabled)) { if (m_replyModel) { m_replyModel->disconnect(this); m_replyModel->deleteLater(); diff --git a/src/timeline/Bubble.qml b/src/timeline/Bubble.qml index b76e4d0f8..c91fffc64 100644 --- a/src/timeline/Bubble.qml +++ b/src/timeline/Bubble.qml @@ -29,7 +29,7 @@ QQC2.Control { * * @sa Quotient::RoomMember */ - property var author + required property var author /** * @brief Whether the message author should be shown. diff --git a/src/timeline/DelegateContextMenu.qml b/src/timeline/DelegateContextMenu.qml index 2e4f3d1f2..2c0f3349c 100644 --- a/src/timeline/DelegateContextMenu.qml +++ b/src/timeline/DelegateContextMenu.qml @@ -163,8 +163,18 @@ KirigamiComponents.ConvergentContextMenu { text: i18nc("@action:inmenu", "Reply") icon.name: "mail-replied-symbolic" onTriggered: { + let threadRoot = root.room.rootIdForThread(root.eventId); + if (threadRoot.length > 0) { + root.room.threadCache.replyId = root.eventId; + root.room.threadCache.threadId = threadRoot; + root.room.mainCache.clearRelations(); + root.room.editCache.clearRelations(); + RoomManager.requestFullScreenClose(); + return; + } root.room.mainCache.replyId = root.eventId; - root.room.editCache.editId = ""; + root.room.editCache.clearRelations(); + root.room.threadCache.clearRelations(); RoomManager.requestFullScreenClose(); } }