Repository navigation
Hide the message button on your own profile - #1061
Merged
Merged
Conversation
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
Contributor
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates InitializeUserProfile to hide the “短消息” button on a user’s own profile by filtering the native mail.php caption link during header construction, while preserving messaging controls on other profiles. Sequence diagram for hiding the self-message profile buttonsequenceDiagram
participant User
participant InitializeUserProfile
participant NativeProfile
participant ProfileHeader
User->>InitializeUserProfile: InitializeUserProfile()
InitializeUserProfile->>NativeProfile: querySelectorAll(a)
alt userID == CurrentUsername and href includes mail.php
InitializeUserProfile-->>ProfileHeader: Skip mail.php link
InitializeUserProfile->>NativeProfile: remove caption
else Other profile or non-mail link
InitializeUserProfile->>ProfileHeader: appendChild(link)
InitializeUserProfile->>NativeProfile: remove caption
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying xmoj-script-dev-channel with
|
| Latest commit: |
09b80aa
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://20689409.xmoj-script-dev-channel.pages.dev |
| Branch Preview URL: | https://hide-self-mail-button.xmoj-script-dev-channel.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR aim to accomplish?:
Closes #1060. Viewing your own profile shows a "短消息" button that would send a message to yourself.
How does this PR accomplish the above?:
The native
userinfo.phpcaption isadmin--高老师<a href=mail.php?to_user=admin>短消息</a>.InitializeUserProfilemoves every caption link into the new profile header. It now skips themail.phplink when the profile's user ID equalsCurrentUsername; the skipped link is discarded along with the caption on the next line. Other users' profiles are unchanged.By submitting this pull request, I confirm the following:
node --checkand confirmed the native caption markup on the live site; not yet exercised in a browser.)🤖 Generated with Claude Code
https://claude.ai/code/session_017dqWu3YgeVRGwBt5pXDq4A
Summary by Sourcery
Prevent users from being offered a message action on their own profile while preserving messaging for other users.
Bug Fixes:
Build:
Chores: