Skip to content

UI access to persistent group ID #8377

Description

@haileyscommit

I'm the developer of 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:

A screenshot of Android notification settings, showing three conversations. The latter two are identical, reflecting the change in shortcut ID due to a change in group membership.

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)

and yes, you can pin these shortcuts:

A screenshot of the ThetaChat app on a home screen, with several conversation shortcuts available.

While reading the Chatmail core spec 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.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions