Try fixing stuck read notifications

This commit is contained in:
Tobias Fella
2022-04-08 20:32:48 +02:00
parent a72cac5ea3
commit 432e209b16
2 changed files with 5 additions and 15 deletions

View File

@@ -120,22 +120,9 @@ ToolBar {
room: currentRoom ?? null room: currentRoom ?? null
} }
Timer {
id: timeoutTimer
repeat: false
interval: 2000
onTriggered: {
repeatTimer.stop()
currentRoom.sendTypingNotification(false)
}
}
Timer { Timer {
id: repeatTimer id: repeatTimer
repeat: true
interval: 3000 interval: 3000
triggeredOnStart: true
onTriggered: currentRoom.sendTypingNotification(true)
} }
function sendMessage(event) { function sendMessage(event) {
@@ -241,8 +228,11 @@ ToolBar {
} }
onTextChanged: { onTextChanged: {
timeoutTimer.restart() if (!repeatTimer.running) {
currentRoom.sendTypingNotification(true)
}
repeatTimer.start() repeatTimer.start()
currentRoom.cachedInput = text currentRoom.cachedInput = text
autoAppeared = false; autoAppeared = false;

View File

@@ -130,7 +130,7 @@ QVariantList NeoChatRoom::getUsersTyping() const
void NeoChatRoom::sendTypingNotification(bool isTyping) void NeoChatRoom::sendTypingNotification(bool isTyping)
{ {
connection()->callApi<SetTypingJob>(BackgroundRequest, localUser()->id(), id(), isTyping, 5000); connection()->callApi<SetTypingJob>(BackgroundRequest, localUser()->id(), id(), isTyping, 3000);
} }
const RoomMessageEvent *NeoChatRoom::lastEvent(bool ignoreStateEvent) const const RoomMessageEvent *NeoChatRoom::lastEvent(bool ignoreStateEvent) const