From f6e836c1778c7e27bf0cad61fbde480fd8a34647 Mon Sep 17 00:00:00 2001 From: boomzero Date: Tue, 6 Oct 2026 19:04:41 +0800 Subject: [PATCH 1/4] Hide the message link on your own profile The native userinfo.php caption contains a mail.php?to_user= link that InitializeUserProfile moved into the profile header for every user, including yourself. Skip it when the profile belongs to the current user. Closes #1060 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A --- XMOJ.user.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 90a45636..78b789ab 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -2666,7 +2666,11 @@ function InitializeUserProfile(isAdmin = false) { // Move the original statistics nodes so their links and handlers survive. table.insertAdjacentElement("beforebegin", profile); - for (let link of table.caption?.querySelectorAll("a") || []) info.appendChild(link); + for (let link of table.caption?.querySelectorAll("a") || []) { + // There is no point in messaging yourself. + if (userID == CurrentUsername && link.getAttribute("href")?.includes("mail.php")) continue; + info.appendChild(link); + } table.caption?.remove(); let solvedCell = [...table.querySelectorAll("td[rowspan]")].find(cell => cell.querySelector('a[href*="problem.php"]') || [...cell.querySelectorAll("script")].some(script => /\bfunction\s+p\s*\(/.test(script.textContent))); From e11ff074c6bf859235e1e7309743322c4f55fc53 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 11:05:08 +0000 Subject: [PATCH 2/4] 4.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2291755b..2244141e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "4.0.1", + "version": "4.0.2", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From 09b80aa4b23b8ac10ac552423f67037f6dfe1b64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 11:05:14 +0000 Subject: [PATCH 3/4] Update version info to 4.0.2 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 0623f008..69096845 100644 --- a/Update.json +++ b/Update.json @@ -3955,6 +3955,17 @@ } ], "Notes": "Add [liushangchen](https://www.xmoj.tech/userinfo.php?user=liushangchen) to AdminUserList" + }, + "4.0.2": { + "UpdateDate": 1791284709068, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 1061, + "Description": "Hide the message button on your own profile" + } + ], + "Notes": "查看自己的个人中心时不再显示“短消息”按钮。" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 78b789ab..a1bfdc4d 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 4.0.1 +// @version 4.0.2 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From c63d7e442ed7f9a2650e5610623ddb1ac6ab9935 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Oct 2026 11:06:12 +0000 Subject: [PATCH 4/4] Update time and description of 4.0.2 --- Update.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 69096845..a8c7b751 100644 --- a/Update.json +++ b/Update.json @@ -3957,7 +3957,7 @@ "Notes": "Add [liushangchen](https://www.xmoj.tech/userinfo.php?user=liushangchen) to AdminUserList" }, "4.0.2": { - "UpdateDate": 1791284709068, + "UpdateDate": 1791284765643, "Prerelease": true, "UpdateContents": [ {