From e4de88fccceeee2a02ce769054bdd782281162cc Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 14 Oct 2021 20:49:46 -0400 Subject: [PATCH] Allow disabling chat cycling --- puppet/README.md | 2 +- puppet/src/puppet.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/puppet/README.md b/puppet/README.md index 4aae3b5..f43db31 100644 --- a/puppet/README.md +++ b/puppet/README.md @@ -13,7 +13,7 @@ The `profile_dir` specifies which directory to put Chromium user data directorie The `extension_dir` specifies which directory contains the files for the LINE extension, which you must download yourself. ### Cycle delay -`cycle_delay` specifies the period (in milliseconds) at which Puppeteer should view chats to check on their read receipts. Only chats with messages that haven't been fully read need to be checked. +`cycle_delay` specifies the period (in milliseconds) at which Puppeteer should view chats to check on their read receipts. Only chats with messages that haven't been fully read need to be checked. Set to a negative value to disable this checking. ### `xdotool` Set `use_xdotool` to `true` to allow the Node process to manipulate the mouse cursor of the X server it runs in. Requires the `xdotool` utility to be installed. Highly recommended, especially when running in a background X server. Its default value is `false` so that running in a non-background X server won't interfere with a real mouse cursor. diff --git a/puppet/src/puppet.js b/puppet/src/puppet.js index bf6546f..8957fe1 100644 --- a/puppet/src/puppet.js +++ b/puppet/src/puppet.js @@ -556,6 +556,11 @@ export default class MessagesPuppeteer { } _cycleTimerStart() { + if (MessagesPuppeteer.cycleDelay < 0) { + this.log("Chat cycling disabled") + return + } + this.cycleTimerID = setTimeout( () => this.taskQueue.push(() => this._cycleChatUnsafe()), MessagesPuppeteer.cycleDelay)