This repository was archived by the owner on Feb 11, 2026. It is now read-only.
Conversation
The spaces panel will display the users own detected RPC activity. This is to make it clear when elecord has succesfully found the game the user is playing.
The icon now checks the users activity is not null before displaying.
Sends the users calculated activity state event to a Matrix room.
When RPC starts and either can't connect or encounters an error. RPC will continually attempt to reconnect to the erpc app.
As RPC messages are only sent once, we can remove the elapsed time function. As it will be calculated by the client receiving the message instead.
RPC messages will be sent to direct message rooms, routeRPC returns a list of routes to these rooms.
Direct message room tiles now display the relevant user's RPC activity (if any) as a subtitle.
Content of state events can't be trusted, so we need to sanitize them first. Then only display events where the state event key (a user ID) matches the user who sent the state event to prevent impersonation.
Watches for changes to state events inside dm rooms.
Users now send a 'activity.status' value. From this, users can check if an activity received is still valid. And when offline, other users will now display the length of time since the activity was sent.
Sending an expire timestamp provides a unique value to prevent the homeserver from rejecting duplicates of sent events. Additionally, the expire timestamp can be used to determine expired events.
Implemented async for potential performance improvements. Added logging in multiple places for easier debugging.
Cloudflare Pages deployment
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request adds elecord's first landmark feature, Rich Presence (RPC). 🎉
Rich Presence lets your friends see what you're playing in real time. When enabled, elecord will show your current game to your friends (also displaying it under your profile picture for you to check as well).
To enable sending Rich Presence, you'll need to download the elecord-rpc app. Just follow the simple on-screen instructions to get started. Once installed, elecord-rpc will run automatically as a lightweight background service, detecting the games you play while using elecord.
Basic explanation
RPC in elecord has two major components, the elecord client, and the elecord-rpc (erpc) server. Both of these run locally on the user's computer. And all RPC communication with other users is done over Matrix using room state events.
Changes
USER
src/components/views/spaces/...SpacePanel.tsx+ calls <UserRPC .../>
src/components/structures/...UserRPC.tsx++ displays user's rpc
++ starts BridgeRPC
src/elecord/rpc/...BridgeRPC.ts++ manages rpc server websocket bridge
RouteRPC.ts++ returns dm room addresses
SendRPC.ts++ sends state events
ROOMS
src/components/views/rooms/...RoomTile.tsx+ provides this.state.isDirectMessage for room tile subtitle
RoomTileSubtitle.tsx+ calls <RoomTileRPC .../>
RoomTileRPC.tsx++ displays room tile rpc
src/elecord/rpc/...ParseRoomRPC.ts++ manages external state events
Future features
Warning
There is currently a temporary limit of up to 8 friends to send RPC messages (this is to prevent unintentionally spamming your homeserver with RPC state events). If you're an existing Matrix user with more than eight direct message rooms, I'd currently advise against using elecord until this issue is resolved.
Note
RPC might not always detect your game reliably (especially for new game releases). This is a known issue and game detection will be continuously improved with future updates.