-
Notifications
You must be signed in to change notification settings - Fork 17
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
Invite by email a new user failed (#479) #482
Conversation
let identityService = MXIdentityService(identityServer: identityServerURL, | ||
accessToken: nil, | ||
accessToken: accessToken, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could not provide this access token here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IdentityService instance has been removed here.
@@ -120,7 +111,7 @@ final class InviteService: InviteServiceType { | |||
// Check whether a Tchap account has been created for this email. The closure returns a nil identifier when no account exists. | |||
private func discoverUser(with email: String, completion: @escaping (MXResponse<InviteServiceDiscoverUserResult>) -> Void) { | |||
let pid = MX3PID(medium: .email, address: email) | |||
_ = self.identityService.lookup3PIDs([pid]) { response in | |||
_ = self.session.identityService.lookup3PIDs([pid]) { response in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your current implementation doesn't satisfy "The closure returns a nil identifier when no account exists."
We will sync about in direct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed in the last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - test ok
@@ -120,12 +111,16 @@ final class InviteService: InviteServiceType { | |||
// Check whether a Tchap account has been created for this email. The closure returns a nil identifier when no account exists. | |||
private func discoverUser(with email: String, completion: @escaping (MXResponse<InviteServiceDiscoverUserResult>) -> Void) { | |||
let pid = MX3PID(medium: .email, address: email) | |||
_ = self.identityService.lookup3PIDs([pid]) { response in | |||
guard let identityService = self.session.identityService else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a good practice, we would move the guard let as the first position of the block
(let pid... should be archived after the guard let)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this on the last commit.
#479