Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support email invite #3739

Merged
merged 6 commits into from
Aug 27, 2021
Merged

support email invite #3739

merged 6 commits into from
Aug 27, 2021

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Jul 27, 2021

Fixes #3695
Fixes #3691

Supports accepting email invite when the email is not bound to the account.

When your email is bound to an identity server and you are invited by email to a room, the invite will come down as part of the sync and the invite will appear in the UI. If not (no identity server or no mail bound), the invite will not show in the UX.

This PR will allow to accept invites on Element Android when your email is not bound to an IS by using Ephemeral Invitation Signing
When clicking on the link of the email invite, EA will open and will allow you to validate the invitation.

NB: The link generated in the API is a v1 link that is deprecated, so EA will use v1 API. v2 API cannot be used now because it requires auth and accept terms, and it degrades the invite flow too much.

Ideally EA should perform the signing locally as it as all info and is crypto capabale, but the documentation is not saying what the signing should be :/

image

Web would display:
image

The email invite looks like that

https://app.element.io/#/room/!MOIPZPtFnMAazZzotO:eample.org?
email=john+doe@mail.com
&signurl=https://vector.im/_matrix/identity/api/v1/sign-ed25519?token=XmOwRZnSFabCRhTywFbIURTTysOpXIbroMGaUymqkJSvHeVKRsjHajwjCYdBsvGSvHauxbKfJmOxtXldtyLnyBMLKpBQCMzyYggrdapbVIceWZBtmslOQrXLABRoe&private_key=T2gq0c3kJB_8OroXVxl1pBnzHsN7V6Xn4bEBSeW1ep4
&room_name=Team2
&room_avatar_url=
&inviter_name=hiphop5
&guest_access_token=&guest_user_id=

In prevision of MSC3288 this PR also support a room_type event in the link in order to adapt the invite text.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some first remarks, will test later

@@ -253,7 +253,7 @@ internal interface RoomAPI {
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "join/{roomIdOrAlias}")
suspend fun join(@Path("roomIdOrAlias") roomIdOrAlias: String,
@Query("server_name") viaServers: List<String>,
@Body params: Map<String, String?>): JoinRoomResponse
@Body params: @JvmSuppressWildcards Map<String, Any>): JoinRoomResponse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use JsonDict ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

vector/src/main/res/values/strings.xml Show resolved Hide resolved
vector/src/main/res/values/strings.xml Show resolved Hide resolved
vector/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@BillCarsonFr BillCarsonFr added A-Spaces Spaces, groups, communities A-3PIDs labels Jul 30, 2021
@BillCarsonFr BillCarsonFr force-pushed the feature/bca/accept_unbound_3pid_invite branch from 62458f0 to af8dd26 Compare July 30, 2021 10:10
@BillCarsonFr BillCarsonFr added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Aug 24, 2021
@BillCarsonFr BillCarsonFr force-pushed the feature/bca/accept_unbound_3pid_invite branch from af8dd26 to 6c2a052 Compare August 24, 2021 14:27
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

@bmarty bmarty enabled auto-merge August 27, 2021 15:08
@BillCarsonFr BillCarsonFr force-pushed the feature/bca/accept_unbound_3pid_invite branch from f73eb91 to efa9ff0 Compare August 27, 2021 15:30
@bmarty bmarty merged commit 65c8ae3 into develop Aug 27, 2021
@bmarty bmarty deleted the feature/bca/accept_unbound_3pid_invite branch August 27, 2021 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-3PIDs A-Spaces Spaces, groups, communities Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
2 participants