From 39b96b60bc328a3d272cea166ab0914616c395f1 Mon Sep 17 00:00:00 2001 From: boomzero Date: Mon, 23 Feb 2026 20:12:55 +0800 Subject: [PATCH 1/9] Gate WebSocket toast notifications by per-feature popup settings The WebSocket handler called CreateAndShowBBSMentionToast and CreateAndShowMailMentionToast unconditionally, ignoring the user's BBSPopup/MessagePopup toggle. This made behavior differ from the polling fallback, which already checks UtilityEnabled() per type. Co-Authored-By: Claude Opus 4.6 --- XMOJ.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index f442f8af..c22ae7aa 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -650,11 +650,13 @@ function HandleNotificationMessage(event) { console.log("WebSocket: Server confirmed connection at timestamp", notification.timestamp); } } else if (notification.type === 'bbs_mention') { - // Backend now provides all data needed for immediate display - CreateAndShowBBSMentionToast(notification.data); + if (UtilityEnabled("BBSPopup")) { + CreateAndShowBBSMentionToast(notification.data); + } } else if (notification.type === 'mail_mention') { - // Backend now provides all data needed for immediate display - CreateAndShowMailMentionToast(notification.data); + if (UtilityEnabled("MessagePopup")) { + CreateAndShowMailMentionToast(notification.data); + } } else if (notification.type === 'pong') { if (UtilityEnabled("DebugMode")) { console.log("WebSocket: Received pong"); From b29e467fc852fe180c399255ce64eef827d6b406 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:14:01 +0000 Subject: [PATCH 2/9] 3.2.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33bff641..48211b03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "3.2.1", + "version": "3.2.2", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From 242ac896ea205ae4a7e35d27fc658388219ff06c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:14:07 +0000 Subject: [PATCH 3/9] Update version info to 3.2.2 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index a732b808..9245a746 100644 --- a/Update.json +++ b/Update.json @@ -3396,6 +3396,17 @@ } ], "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" + }, + "3.2.2": { + "UpdateDate": 1771848841818, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 919, + "Description": "Gate WebSocket toast notifications by per-feature popup settings" + } + ], + "Notes": "Fix WebSocket notification toasts ignoring per-feature popup settings (BBSPopup/MessagePopup)." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index c22ae7aa..76c959ad 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 3.2.1 +// @version 3.2.2 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 4e02591743c505eb2c9d3514bf30e1ae4e075920 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:14:19 +0000 Subject: [PATCH 4/9] Update time and description of 3.2.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 9245a746..fd2ce19d 100644 --- a/Update.json +++ b/Update.json @@ -3398,7 +3398,7 @@ "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" }, "3.2.2": { - "UpdateDate": 1771848841818, + "UpdateDate": 1771848859037, "Prerelease": true, "UpdateContents": [ { From b36a7af18b99e02eb0ccc69544199f9e5065d912 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:14:56 +0000 Subject: [PATCH 5/9] Update time and description of 3.2.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index fd2ce19d..5e83125a 100644 --- a/Update.json +++ b/Update.json @@ -3398,7 +3398,7 @@ "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" }, "3.2.2": { - "UpdateDate": 1771848859037, + "UpdateDate": 1771848890966, "Prerelease": true, "UpdateContents": [ { From d40408e137069062715512b5b6e0973fba64d233 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:15:09 +0000 Subject: [PATCH 6/9] Update time and description of 3.2.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 5e83125a..4fde1618 100644 --- a/Update.json +++ b/Update.json @@ -3398,7 +3398,7 @@ "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" }, "3.2.2": { - "UpdateDate": 1771848890966, + "UpdateDate": 1771848908637, "Prerelease": true, "UpdateContents": [ { From 4525aad96ee645caea449960b770eb2735ee5605 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:15:43 +0000 Subject: [PATCH 7/9] Update time and description of 3.2.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 4fde1618..b125dda8 100644 --- a/Update.json +++ b/Update.json @@ -3398,7 +3398,7 @@ "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" }, "3.2.2": { - "UpdateDate": 1771848908637, + "UpdateDate": 1771848938055, "Prerelease": true, "UpdateContents": [ { From 525a7223e5e86e3886287196d30b0dd9186ad616 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:15:52 +0000 Subject: [PATCH 8/9] Update time and description of 3.2.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index b125dda8..d7851a41 100644 --- a/Update.json +++ b/Update.json @@ -3398,7 +3398,7 @@ "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" }, "3.2.2": { - "UpdateDate": 1771848938055, + "UpdateDate": 1771848951250, "Prerelease": true, "UpdateContents": [ { From f63b4d312a0702e4708775ba3498521df37a5e28 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 12:16:38 +0000 Subject: [PATCH 9/9] Update time and description of 3.2.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index d7851a41..3cde5c6c 100644 --- a/Update.json +++ b/Update.json @@ -3398,7 +3398,7 @@ "Notes": "Fix contest ranking table colors in dark mode (contestrank-oi.php and contestrank-correct.php)" }, "3.2.2": { - "UpdateDate": 1771848951250, + "UpdateDate": 1771848993140, "Prerelease": true, "UpdateContents": [ {