-
Notifications
You must be signed in to change notification settings - Fork 216
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
Verification request and QR listener in Crypto V2 #1663
Conversation
57ec49a
to
1a8c46e
Compare
4184f5c
to
574641d
Compare
574641d
to
a93c146
Compare
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
(just left a couple of minor comments)
if state != oldValue { | ||
log.debug("\(oldValue.description) -> \(state.description)") | ||
|
||
DispatchQueue.main.async { | ||
NotificationCenter.default.post(name: .MXKeyVerificationRequestDidChange, object: self) | ||
} | ||
} |
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.
if state != oldValue { | |
log.debug("\(oldValue.description) -> \(state.description)") | |
DispatchQueue.main.async { | |
NotificationCenter.default.post(name: .MXKeyVerificationRequestDidChange, object: self) | |
} | |
} | |
guard state != oldValue else { return } | |
log.debug("\(oldValue.description) -> \(state.description)") | |
DispatchQueue.main.async { | |
NotificationCenter.default.post(name: .MXKeyVerificationRequestDidChange, object: self) | |
} |
qrCode.state | ||
private(set) var state: MXQRCodeTransactionState = .unknown { | ||
didSet { | ||
if state != oldValue { |
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.
Same guard
consideration
Integrate verification signalling which exposes state stream for
VerificationRequest
andQrCode
the same way as was previously done forSAS
. This makes it possible to completely removeupdatePendingVerification
method which manually compares the state of verification objects.There are a few things that this PR does not address yet and will be resolved in future PR:
actor
type to make concurrency more rigorousprocessOutgoingRequests
from multiple places also makes it less obvious when and how this should be called (after sync, after decrypting events, ...)