Support replying and editing messages directly from room search
There's two parts to making this work mainly: 1. Use getEvent instead of findInTimeline so the related event is actually found. 2. Close the dialog once a reply relation is found, so you can easily reply in the chat bar.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
import QtQuick
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
import org.kde.neochat.libneochat
|
||||
import org.kde.neochat.timeline
|
||||
|
||||
@@ -45,4 +47,15 @@ SearchPage {
|
||||
noResultPlaceholderMessage: i18n("No messages found")
|
||||
|
||||
listVerticalLayoutDirection: ListView.BottomToTop
|
||||
|
||||
Connections {
|
||||
target: root.room.mainCache
|
||||
|
||||
function onRelationIdChanged(oldEventId: string, newEventId: string): void {
|
||||
// If we start replying/editing an event, we need to close the search dialog so the user can type.
|
||||
if (newEventId.length > 0) {
|
||||
root.Kirigami.PageStack.closeDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user