-
Notifications
You must be signed in to change notification settings - Fork 214
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
[WIP] MX3PidAddManager: New class to handle add 3pids to HS and to bind to IS #726
Conversation
@@ -1365,6 +1368,27 @@ public extension MXRestClient { | |||
@nonobjc @discardableResult func addThirdPartyIdentifier(_ sid: String, clientSecret: String, bind: Bool, completion: @escaping (_ response: MXResponse<Void>) -> Void) -> MXHTTPOperation { |
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.
We can add depreciation annotation on method like this:
@available(*, deprecated, message: "use addThirdPartyIdentifierOnly instead")
} failure:failure]; | ||
} | ||
|
||
- (MXHTTPOperation *)doesServerSupportSeparateAddAndBind:(void (^)(bool doesServerSupportSeparateAddAndBind))success |
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.
Prefer use BOOL
instead bool
for doesServerSupportSeparateAddAndBind
.
|
||
#pragma mark - Bind Email | ||
|
||
- (MX3PidAddSession*)startIdentityServerEmailSessionWithEmail:(NSString*)email |
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.
Maybe rename startIdentityServerBindEmailSessionWithEmail
to add more context like startAddEmailSessionWithEmail
above.
return threePidAddSession; | ||
} | ||
|
||
- (void)tryFinaliseIdentityServerEmailSession:(MX3PidAddSession*)threePidAddSession |
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.
Maybe rename tryFinaliseIdentityServerBindEmailSession to add more context like
tryFinaliseAddEmailSession` above.
|
||
threePidAddSession.httpOperation = nil; | ||
|
||
NSLog(@"[MX3PidAddManager] tryFinaliseIdentityServer3PidSessionWithNewHomeserver: DONE: threePid: %@", threePidAddSession); |
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.
startIdentityServer3PidSession
instead of tryFinaliseIdentityServer3PidSessionWithNewHomeserver
.
This manager handles all HS flags. It adds, binds, unbinds 3pids, accordingly.
Apps should use it instead of MXK3Pid.
Note: All possible IS configurations are already managed by the
MXIdentityService
this manager uses.Part of element-hq/element-ios#2713:
m.separate_add_and_bind
)POST /_matrix/client/r0/account/3pid/bind
,POST /_matrix/client/r0/account/3pid/unbind
, andPOST /_matrix/client/r0/account/3pid/add
/unstable
prefix for APIs