Added Masqurade feature and the coresponding permision - #42
Conversation
📝 WalkthroughWalkthroughAdds a new MASQUERADE role permission bit with display metadata. The message creation route accepts optional avatar_url_override/username_override fields, validates them, enforces MASQUERADE permission and DM channel restrictions, and forwards overrides to message creation. Message transformation now handles creator override data differently for webhook and non-webhook messages. ChangesMasquerade Permission and Message Override Flow
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ade in DM channels
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/routes/channels/channelMessageCreate.ts`:
- Around line 41-42: The validators in channelMessageCreate are attached to the
wrong request fields, so the masquerade inputs bypass validation. Update the
body() checks in the validation chain to target the actual override keys used by
this route, specifically the avatar and username override fields read by
channelMessageCreate, so the existing string/length/character rules apply to the
correct inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 801864d9-b122-4818-8627-bd83000315b7
📒 Files selected for processing (3)
src/common/Bitwise.tssrc/routes/channels/channelMessageCreate.tssrc/services/Message/Message.ts
Pull Request Template
What does this PR do?
Changes Made
src/common/Bitwise.ts, Added the role permision (its bit 9)src/routes/channels/channelMessageCreate.ts, added the check if the user has the permision and added the coresponding things to the interfacessrc/services/Message/Message.ts, added the creator override content to make sure that the frontend gets the masquerade dataChecklist
Testing
Additional Notes), proxy, cdn and serveravatar_url_overrideorusername_overrideexists in the request body of the routeAdditional Notes
Summary by CodeRabbit
usernameandavataroverrides (with validation) during message creation.