Repository navigation
Feature: Discord Rich Presence - #139
Conversation
|
Hey, @hitblast i looked at implementation of discord ipc client , and it appears to be having MSRV of |
|
@Sreehari425 Oh, forgot to adjust the edition to |
|
my thoughts:
|
I was thinking about the async part, as its mostly just UnixStream being handed off to separate threads in the deep level. I'll work on implementing Looking forward! |
Co-authored-by: SreehariAnil255 <69724114+Sreehari425@users.noreply.github.com>
|
Update: I'm currently a little busy and will return to this PR once I'm done. |
|
@Mrmayman @Sreehari425 A little update; I've implemented a base configuration for the rich presence functionality which includes a few different things now:
I'll need some review over my implementation since I am a bit rusty with iced but hopefully we can build upon this to integrate it into several other views and functions of the launcher. |
|
Alright i read through your code, seems okay 👍 you can continue like that btw if you need me at any time, i'll finally be free for help with this PR and general development after next Wednesday, when my exams get over. Till then i may be a bit slow to respond or work on stuff but i'll try to help |
Sure! For the most part, I'm interested about the states which you want to put rich presence updates in (for example in certain views such as the mod menu or instance selections). I'd also need some help regarding what details to put in them. That's about it. Appreciate it. |
70b4b8d to
18420e1
Compare
- Move config fields to separate struct - Split message into separate `RpcMessage` - Many tweaks to data types and how it's stored - Code cleanup
|
Ok all the review, testing and tweaks from my side are done 👍 i made some changes:
let me see if Copilot has anything to see (AI review) |
There was a problem hiding this comment.
Pull request overview
Adds Discord Rich Presence integration to QuantumLauncher (via filthy-rich), including UI controls and configuration for enabling/disabling and customizing presence text.
Changes:
- Introduces Discord RPC config (
discord_rpc) and new “Presence” settings tab to manage Rich Presence behavior and text. - Starts and manages a Discord IPC runner, updates presence on launcher/game lifecycle events, and surfaces status in the UI.
- Adjusts macOS packaging/build scripts and workflow app bundle naming; updates onboarding changelog/welcome screens to include RPC toggles.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/sequoia_arm64_build.sh | Adds a macOS 15 (Sequoia) arm64 build + .app bundling script. |
| quantum_launcher/src/view.rs | Wires is_presence_running into settings view; passes config into changelog view. |
| quantum_launcher/src/update.rs | Handles new Discord IPC lifecycle messages; returns Task from game-exit handling. |
| quantum_launcher/src/state/mod.rs | Adds launcher state for Discord IPC client + presence-running flag. |
| quantum_launcher/src/state/message.rs | Adds RPC-related messages and conversions into the existing message model. |
| quantum_launcher/src/state/menu.rs | Adds a new “Presence” tab to launcher settings navigation. |
| quantum_launcher/src/message_update/mod.rs | Implements RPC settings updates, enable/disable behavior, and settings-state helper. |
| quantum_launcher/src/message_update/edit_instance.rs | Refactors Option initialization to get_or_insert_default(). |
| quantum_launcher/src/message_update/accounts.rs | Refactors accounts config initialization to get_or_insert_default(). |
| quantum_launcher/src/message_handler/mod.rs | Implements presence updates on game open/exit; adds IPC runner start + set-presence helpers. |
| quantum_launcher/src/message_handler/iced_event.rs | Uses new settings-state helper; refactors Option init for window config. |
| quantum_launcher/src/menu_renderer/settings/tab_presence.rs | New Presence settings tab UI for toggles + text customization. |
| quantum_launcher/src/menu_renderer/settings/mod.rs | Registers Presence tab and threads presence-running state into settings rendering. |
| quantum_launcher/src/menu_renderer/onboarding/welcome.rs | Adds an onboarding toggle to enable Discord Rich Presence. |
| quantum_launcher/src/menu_renderer/onboarding/changelog.rs | Adds RPC toggle to changelog screen; updates/rewrites changelog content. |
| quantum_launcher/src/menu_renderer/mod.rs | Changes changelog view to accept config and forward to changelog renderer. |
| quantum_launcher/src/main.rs | Starts Discord IPC runner at startup when RPC is enabled in config. |
| quantum_launcher/src/config/mod.rs | Adds discord_rpc config field, helpers (c_rpc_enabled, reset_presence), and module export. |
| quantum_launcher/src/config/discord_rpc.rs | New serialized RPC config types + defaults and text templates. |
| quantum_launcher/Cargo.toml | Adds filthy-rich dependency (and reorders/normalizes some deps). |
| crates/ql_packager/src/multimc.rs | Refactors Option initialization to get_or_insert_default(). |
| crates/ql_mod_manager/src/loaders/optifine.rs | Refactors Option initialization to get_or_insert_default() and simplifies imports. |
| crates/ql_core/src/json/instance_config.rs | Refactors Option initialization to get_or_insert_default(). |
| changelogs/unreleased.md | Documents the new Discord Rich Presence feature in the unreleased changelog. |
| Cargo.lock | Locks in filthy-rich and updates transitive deps (e.g., tokio/mio). |
| .github/workflows/release.yml | Normalizes macOS .app bundle directory name. |
| .github/workflows/build-macos.yml | Normalizes macOS .app bundle directory name and adjusts deployment env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // On disable | ||
| let client = self.discord_ipc_client.clone(); | ||
| self.is_presence_running = false; | ||
|
|
||
| tokio::spawn(async move { | ||
| if let Some(c) = client { | ||
| _ = c.close().await; | ||
| } | ||
| }); |
There was a problem hiding this comment.
When RPC is toggled off, the code closes the client asynchronously but leaves self.discord_ipc_client populated. This keeps a stale handle around and makes it harder to reason about later updates (and interacts with in-flight DiscordIPCRunStarted/DiscordIPCPresenceSet messages). Clear self.discord_ipc_client (and consider ignoring/closing any late-started client) as part of the disable path.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@hitblast can you take a look at these |
|
LGTM, merging |
TL;DR: I'm trying to get Discord's Rich Presence connected with the launcher using a tiny library that I'm working on alongside this PR. Here is the link in case if you want to check out.
As of now, I'll be working on it actively until I hit compatibility on all three major platforms, till then I have some goals which I'll put here:
iced.More will be added as the feature continues. I'd like your consideration on this as it'd be a tough time deciding what messages and states to include this. Currently I've only modified the
Launcherstate to support this, which I assumed is shared globally (I might be wrong here).Cheers.