Repository navigation
feat(discord): Join button for the server's Discord invite (C2, client part) - #707
Open
sven-n wants to merge 4 commits into
Conversation
The options window's Discord row gets a Join button that opens the server's Discord invite (config.ini [Discord] InviteUrl) through SDL_OpenURL, in the Discord app or the browser. Only Discord invite links (https://discord.gg/<code>, https://discord.com/invite/<code>) are accepted: the link will come from the server once the integration info packet exists (#698), and nothing else may reach the system's URL handler. With no or an invalid link the button is not shown. The client-side part of #698 that needs no server support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012feEciycvL8PGjsezyRFqj
This was referenced Oct 10, 2026
sven-n
commented
Oct 10, 2026
sven-n
left a comment
Owner
Author
There was a problem hiding this comment.
Part of a review pass over the whole Discord integration.
Small, focused PR and the one security-relevant decision in it — never handing an unvalidated URL to the system handler — is made correctly and for the stated reason. One comment inline about which legitimate invites the validation turns away.
Generated by Claude Code
3 tasks done
…discord-presence-mumain-597-l2q09d-c2-invite
- Invite links may carry a query or fragment, like the "?event=..." of a shared event or the "?utm_source=..." of a link copied from the web client. The code is checked up to the first '?' or '#'; what follows has to be URL-safe characters only, and is opened unchanged. - Invite::Accept logs a non-empty link which isn't an invite (once), so a typo in config.ini doesn't just look like no invite at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012feEciycvL8PGjsezyRFqj
…discord-presence-mumain-597-l2q09d-c2-invite The Join button moves to the RmlUi options window with the Discord setting: shown in the Discord row while config.ini holds a valid invite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01USFZ9xErMB1EwkpfdUHzoZ
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.
Summary
The part of C2 that needs no server support: a Join button for the server's Discord invite.
config.ini [Discord] InviteUrlholds the invite link to the server's Discord. Shipping it is up to the operator; it is empty by default.SDL_OpenURL, which works on every platform, unlike the Windows-onlyShellExecutehelper.https://discord.gg/<code>orhttps://discord.com/invite/<code>(alsowww.discord.comanddiscordapp.com). The code may only contain letters, digits and dashes, and nothing may follow it. The link will come from the server once the integration info packet exists, so nothing else may ever reach the system's URL handler. With no link or an invalid one, the button is not shown.ENABLE_DISCORD,Invite.hcompiles to no-ops, likeRichPresence.h.docs/discord.md: a new "Joining the server's Discord" section and theInviteUrlkey in the operator setup.What's left of #698 (needs OpenMU M2/M3): the
F5integration info request and response, bumpingOpenMuPacketsVersion, and filling the invite URL and application id from the server, withconfig.inias the fallback. The Join button andInvite::Openare what that packet handler will use.Verification
linux-x64Debug build: fullctestrun, 440/440 passed, including 3 new tests: accepted invite forms; refused look-alikes (wrong scheme, wrong host, extra path, query strings,file://, over-long codes);Openrefusing a non-invite link.MU_ENABLE_DISCORDundefined.Related issues
Part of #698 (C2). Does not close it: the server-provided integration info is still to come.
Checklist
docs/CODING_RULES.md.docs/build/README.md).🤖 Generated with Claude Code
https://claude.ai/code/session_012feEciycvL8PGjsezyRFqj
Generated by Claude Code