summaryrefslogtreecommitdiffstats
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2023-02-23 21:57:53 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2023-02-28 20:10:25 -0500
commitb6ef00b5ee14bd0adc85c3a98bb8a127f79932ea (patch)
treedf09acee8f648cea85aa75bfcd43b6f247e8cc81 /resources/qml/TimelineView.qml
parent9043087c80dac7eea761efcfd6f289efa5bd4a94 (diff)
Show warning when invalid command is entered
Fixes #1363 Please note that this doesn't prompt when you try to send a message with a bad command.
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r--resources/qml/TimelineView.qml19
1 files changed, 18 insertions, 1 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index e836f60f..5c982270 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -153,13 +153,30 @@ Item {
UploadBox {
}
- NotificationWarning {
+ MessageInputWarning {
+ text: qsTr("You are about to notify the whole room")
+ isVisible: (room && room.permissions.canPingRoom() && room.input.containsAtRoom)
+ }
+
+ MessageInputWarning {
+ text: qsTr("The command /%1 is not recognized and will be sent as part of your message").arg(Nheko.getCommandFromText(input.text))
+ isVisible: {
+ if (!input.text)
+ return false;
+
+ let command = Nheko.getCommandFromText(input.text);
+ if (Nheko.isInvalidCommand(command) && ("/" + command !== input.text))
+ return true;
+ else
+ return false;
+ }
}
ReplyPopup {
}
MessageInput {
+ id: input
}
}