From 7c2a152cfbc2197989f7d722deb961ac80269019 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 8 Mar 2024 18:43:59 +0100 Subject: Add support for intentional mentions This is still a bit flaky around when to remove a mention, but it should work in most cases. Might add a toggle in the future to disable these though. --- resources/qml/TimelineView.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'resources/qml/TimelineView.qml') diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 7bad53c4..085ca073 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -148,9 +148,16 @@ Item { } UploadBox { } - MessageInputWarning { - text: qsTr("You are about to notify the whole room") - visible: (room && room.permissions.canPingRoom() && room.input.containsAtRoom) + Repeater { + model: room ? room.input.mentions : null + + MessageInputWarning { + required property string modelData + bubbleColor: modelData == "@room" ? Nheko.theme.error : Nheko.theme.orange + text: modelData == "@room" ? qsTr("You are about to notify the whole room") : qsTr("You will be mentioning %1").arg(modelData) + showRemove: true + onRemoveClicked: room.input.removeMention(modelData); + } } MessageInputWarning { text: qsTr("The command /%1 is not recognized and will be sent as part of your message").arg(room ? room.input.currentCommand : "") -- cgit 1.5.1