summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-09-02 03:15:07 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-09-02 03:15:39 +0200
commit3528fe4e5dee1684f43e14fc9c6a50b4c1e25faf (patch)
treede846207ac1332fd8ae97662c3c8fbe4540b4dbf /resources
parentTranslated using Weblate (Estonian) (diff)
downloadnheko-3528fe4e5dee1684f43e14fc9c6a50b4c1e25faf.tar.xz
Warn the user before they ping the whole room
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/MessageInput.qml2
-rw-r--r--resources/qml/NotificationWarning.qml38
-rw-r--r--resources/qml/TimelineView.qml3
-rw-r--r--resources/res.qrc1
4 files changed, 43 insertions, 1 deletions
diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml
index e1bf3f06..c95929ce 100644
--- a/resources/qml/MessageInput.qml
+++ b/resources/qml/MessageInput.qml
@@ -268,7 +268,7 @@ Rectangle {
                     function onRoomChanged() {
                         messageInput.clear();
                         if (room)
-                            messageInput.append(room.input.text());
+                            messageInput.append(room.input.text);
 
                         popup.completerName = "";
                         messageInput.forceActiveFocus();
diff --git a/resources/qml/NotificationWarning.qml b/resources/qml/NotificationWarning.qml
new file mode 100644
index 00000000..b606581b
--- /dev/null
+++ b/resources/qml/NotificationWarning.qml
@@ -0,0 +1,38 @@
+// SPDX-FileCopyrightText: 2021 Nheko Contributors
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Layouts 1.2
+import im.nheko 1.0
+
+Item {
+    implicitHeight: warningRect.visible ? warningDisplay.implicitHeight : 0
+    height: implicitHeight
+    Layout.fillWidth: true
+
+    Rectangle {
+        id: warningRect
+
+        visible: (room && room.permissions.canPingRoom && room.input.containsAtRoom)
+        color: Nheko.colors.base
+        anchors.fill: parent
+        z: 3
+
+        Label {
+            id: warningDisplay
+
+            anchors.left: parent.left
+            anchors.leftMargin: 10
+            anchors.right: parent.right
+            anchors.rightMargin: 10
+            anchors.bottom: parent.bottom
+            color: Nheko.theme.red
+            text: qsTr("You will be pinging the whole room")
+            textFormat: Text.PlainText
+        }
+
+    }
+
+}
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 9bc4bef0..f12060f2 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -123,6 +123,9 @@ Item {
             color: Nheko.theme.separator
         }
 
+        NotificationWarning {
+        }
+
         ReplyPopup {
         }
 
diff --git a/resources/res.qrc b/resources/res.qrc
index b46b726c..3514ebca 100644
--- a/resources/res.qrc
+++ b/resources/res.qrc
@@ -138,6 +138,7 @@
         <file>qml/QuickSwitcher.qml</file>
         <file>qml/ForwardCompleter.qml</file>
         <file>qml/TypingIndicator.qml</file>
+        <file>qml/NotificationWarning.qml</file>
         <file>qml/RoomSettings.qml</file>
         <file>qml/emoji/EmojiPicker.qml</file>
         <file>qml/emoji/StickerPicker.qml</file>