Repository navigation
feat(messenger): send an invitation with the group invite link - #1500
Merged
Merged
Conversation
The group invite share put the bare URL in EXTRA_TEXT, so the recipient got a link and nothing saying what it was. iOS' GroupInviteSheet now names the group ahead of the link, and this matches it: "Join <title> on Flipcash and let's chat", a blank line, then the URL. The blank line is what keeps the URL unfurling on its own rather than running into the sentence. A group with no title has nothing to name, so it keeps sharing the bare link. EXTRA_TITLE/EXTRA_SUBJECT carry the same sentence, the way shareToken uses title_shareToken in both slots. message_groupInvite replaces subtitle_shareGroupInvite, which was drafted for this slot and never referenced. The copy action is untouched — ChatViewModel still copies the URL verbatim, since a sentence pasted into a URL bar is worse than the gap being closed. Adds the module's first test source set; both cases are asserted through the chooser's EXTRA_INTENT under Robolectric.
Three things about the group invite. The profile row's icon was ic_group_3, a three-person glyph naming a group rather than the act of adding to one. iOS' same row draws person.badge.plus, so this draws Icons.Outlined.PersonAdd — the Material glyph closest to it, and the same kind of vector the Leave row beside it already uses. The Sharesheet now carries the group's picture as its preview thumbnail, so what is being invited to is recognisable before it is sent. The image goes out as ClipData, which needs a content:// URI another process can open, so SharePreviewImage loads the rendition through the app's shared Coil loader — keyed on the durable blob id, so it hits what the screen already downloaded — and writes it into the share_previews cache the tip-code previews use. Best effort throughout: no picture, a slow fetch or an expired download URL all share what they shared before. The URL is resolved in the sheet rather than in the share controller, because re-minting an expired one needs the chat's profile to authorize it and the shareable module sees nothing of :services:flipcash. An untitled group reached the controller as "" rather than null — ChatSubject.Group.title is groupTitle.orEmpty() — so the invitation would have named a group with a hole where the name goes. Blank now falls back to the bare link the way null does, which is what iOS' GroupInviteShareItem does with the same value.
EXTRA_TITLE carried the invitation sentence, so the Sharesheet drew it as the headline directly above the same sentence as the first line of the body — and truncated it there, the headline being a single line. The group's name is what that slot is for. EXTRA_SUBJECT keeps the sentence. It is an email's subject line rather than a headline sitting above a body, so there is nothing to repeat.
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.
"Send Invite Link" put the bare URL in the share sheet, so the recipient got a link with no
indication of what it opens. iOS'
GroupInviteShareItemnow sends a sentence ahead of it; thismatches the wording exactly.
The same sentence fills
EXTRA_TITLE/EXTRA_SUBJECT, the wayshareTokenusestitle_shareTokenin both slots. A group with no name shares the bare link rather than an invitation with a hole in
it — an untitled group reaches the controller as
"", so the check isisNotBlank, matching iOS'trim-and-check. The copy action is untouched:
ChatViewModelstill copies the URL verbatim, whichis what you want when it is pasted into a URL bar.
subtitle_shareGroupInvite("Join me on Flipcash") was drafted for this slot and never wired. It isreplaced by
message_groupInviterather than left alongside it.Two smaller parity fixes ride along:
ic_group_3, which names a group rather than the act of addingto one. iOS uses
person.badge.pluson the same row, so it is nowIcons.Outlined.PersonAdd. The@glyph stays where it belongs — the row inside the sheet this opens, where it stands for theusername the link is sent to (node 10127:118328).
the intent's
ClipData, not from any extra, soSharePreviewImagecaches the rendition through theFileProvider path the tip-card preview already uses and passes a
content://URI. Best-effort: nopicture, a slow fetch or an expired URL each share exactly what they shared before. API 29+ only,
and Android-only — iOS sets no image on its
LPLinkMetadata.The picture URL is resolved in
GroupInviteSheetrather than in the share controller. The storeddownload URL expires, and re-minting it needs
BlobAccessContext.ChatProfile, which:apps:flipcash:shared:shareablecannot see: it depends on:libs:messaging, not:services:flipcash.Only a
String?URL and a cache key cross that boundary.One thing this cannot match: iOS returns the bare URL to AirDrop and Slack, both of which render a
link preview themselves.
ACTION_SENDcarries oneEXTRA_TEXTto every target andEXTRA_EXCLUDE_COMPONENTScan only drop a target entirely, so on Android those two receive thesentence as well.
:apps:flipcash:shared:shareablehad no test source set. This adds one, with three cases over thebuilt intent: titled, blank-titled and untitled.