diff --git a/imports/NeoChat/Component/ChatBox/ChatBar.qml b/imports/NeoChat/Component/ChatBox/ChatBar.qml index ec5c750e0..ae8797adb 100644 --- a/imports/NeoChat/Component/ChatBox/ChatBar.qml +++ b/imports/NeoChat/Component/ChatBox/ChatBar.qml @@ -120,22 +120,9 @@ ToolBar { room: currentRoom ?? null } - Timer { - id: timeoutTimer - repeat: false - interval: 2000 - onTriggered: { - repeatTimer.stop() - currentRoom.sendTypingNotification(false) - } - } - Timer { id: repeatTimer - repeat: true interval: 3000 - triggeredOnStart: true - onTriggered: currentRoom.sendTypingNotification(true) } function sendMessage(event) { @@ -241,8 +228,11 @@ ToolBar { } onTextChanged: { - timeoutTimer.restart() + if (!repeatTimer.running) { + currentRoom.sendTypingNotification(true) + } repeatTimer.start() + currentRoom.cachedInput = text autoAppeared = false; diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index b8dc184e4..09d527770 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -130,7 +130,7 @@ QVariantList NeoChatRoom::getUsersTyping() const void NeoChatRoom::sendTypingNotification(bool isTyping) { - connection()->callApi(BackgroundRequest, localUser()->id(), id(), isTyping, 5000); + connection()->callApi(BackgroundRequest, localUser()->id(), id(), isTyping, 3000); } const RoomMessageEvent *NeoChatRoom::lastEvent(bool ignoreStateEvent) const