From 5595d8f896fc5d5236d8033e8923dbd06de65d92 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Thu, 21 Apr 2022 20:47:59 +0200 Subject: [PATCH] Allow disabling sending of typing notifications --- imports/NeoChat/Component/ChatBox/ChatBar.qml | 2 +- imports/NeoChat/Settings/GeneralSettingsPage.qml | 9 +++++++++ src/neochatconfig.kcfg | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/imports/NeoChat/Component/ChatBox/ChatBar.qml b/imports/NeoChat/Component/ChatBox/ChatBar.qml index 71a274bfb..2b469bd4b 100644 --- a/imports/NeoChat/Component/ChatBox/ChatBar.qml +++ b/imports/NeoChat/Component/ChatBox/ChatBar.qml @@ -229,7 +229,7 @@ ToolBar { } onTextChanged: { - if (!repeatTimer.running) { + if (!repeatTimer.running && Config.typingNotifications) { currentRoom.sendTypingNotification(true) } repeatTimer.start() diff --git a/imports/NeoChat/Settings/GeneralSettingsPage.qml b/imports/NeoChat/Settings/GeneralSettingsPage.qml index 791f7d89a..e2728602a 100644 --- a/imports/NeoChat/Settings/GeneralSettingsPage.qml +++ b/imports/NeoChat/Settings/GeneralSettingsPage.qml @@ -110,6 +110,15 @@ Kirigami.ScrollablePage { Config.save() } } + QQC2.CheckBox { + text: i18n("Send Typing Notifications") + checked: Config.typingNotifications + enabled: !Config.isTypingNotificationsImmutable + onToggled: { + Config.typingNotifications = checked + Config.save() + } + } } } } diff --git a/src/neochatconfig.kcfg b/src/neochatconfig.kcfg index 12fa3b0e4..1b0fe52a2 100644 --- a/src/neochatconfig.kcfg +++ b/src/neochatconfig.kcfg @@ -51,6 +51,9 @@ -1 + + true +