From 3c9b8f4bc9003f32a6079531e4256ec517612475 Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Tue, 6 Jan 2026 20:36:37 +0800 Subject: [PATCH] fixed shared chat bug --- scripts/defaultConfigs.js | 1 + scripts/index.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/scripts/defaultConfigs.js b/scripts/defaultConfigs.js index b92f7f1..6a9f56f 100644 --- a/scripts/defaultConfigs.js +++ b/scripts/defaultConfigs.js @@ -2,6 +2,7 @@ const defaultConfigs = (function () { "use strict"; const settings = { + listenAcrossSharedChat: false, replyInChat: true, // true or false enableLimit: false, // true or false limit: 10, // integer diff --git a/scripts/index.js b/scripts/index.js index f1feabb..668ea54 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -26,6 +26,14 @@ function isStreamer(flags) { } ComfyJS.onCommand = (user, command, message, flags, extra) => { + if (!getSetting("listenAcrossSharedChat")) { + // Reject messages from another chat during shared chat if room information + // is present and doesn't match the current chat. + const { roomId, userState } = extra; + const sourceRoomId = userState["source-room-id"]; + if (roomId && sourceRoomId && roomId !== sourceRoomId) return; + } + command = `!${command.toLowerCase()}`; processCommand(user, command, message, flags, extra);