UI access to persistent group ID
- Dominant language
- Rust
- Stars
- 929
- Forks
- 143
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 53
Description
I'm the developer of [ThetaChat](https://codeberg.org/haileyscommit/thetachat), a work-in-progress chatmail client for Android with a modern Material 3 design. Recently I added support for notification bubbles and shortcuts (these are related for some reason). Each shortcut (and therefore the "conversation" the bubble is made for) uses a shortcut ID, and currently I build that ID using the relevant account's `configured_addr` and the addresses of each participant in the chat using the list returned by `getChatContacts`. For 1-to-1 "single" chats, this works excellent, but for group chats, this ID breaks each time the membership changes, causing shortcuts to no longer apply and conversation notification settings to break:
An alternative approach, and one I'm taking everywhere else in the app, is to use the numeric account and chat IDs. This works well for everything else (think: starting Activities, getting messages, and showing profile pictures); however, it is not recommended for shortcuts on Android:
> Because the system performs backup and restore on pinned shortcuts automatically, these shortcuts' IDs must contain stable, constant strings or server-side identifiers, rather than identifiers generated locally that might not make sense on other devices.
(source: [Create shortcuts - Android Developers](https://developer.android.com/develop/ui/compose/system/shortcuts/creating-shortcuts#:~:text=Note%3A%20Because,devices))
and yes, you can pin these shortcuts:
While reading the [Chatmail core spec](https://github.com/chatmail/core/blob/main/spec.md#groups:~:text=To%20allow,characters,-%2E) earlier, I noticed this:
> To allow different groups with the same members, groups are identified by a group-id.
Of course, that would solve that problem I was having, so I looked to see if there was a way to access it over RPC or C FFI (which itself is over Java), and I could not find one. So, I would like a field or method that lets me read that group-id for the purpose of composing these shortcut IDs. (I was considering going ahead and doing the work but the contributing guidelines said to make an issue before doing that.)
Contributor guide
Research direction
Start by tracing the existing RPC and C FFI entry points that expose chat and group data; the issue does not name specific files or tests. Determine where the stable group-id can be made available, then confirm that a client such as ThetaChat can read it for persistent shortcut IDs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, rust
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100