Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Oct 3, 2023
1 parent 9200f84 commit 4ce13d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ extension MXCryptoMachine: MXCryptoCrossSigning {
}

func queryMissingSecretsFromOtherSessions() async throws {
let has_missing = try machine.queryMissingSecretsFromOtherSessions()
let isMissingSecrets = try machine.queryMissingSecretsFromOtherSessions()

if (has_missing) {
// Out-of-sync check if there are any secret request to sent out as a result of
if (isMissingSecrets) {
// Out-of-sync check if there are any secret request to send out as a result of
// the missing secret request
for request in try machine.outgoingRequests() {
if case .toDevice(_, let eventType, _) = request {
Expand Down
5 changes: 1 addition & 4 deletions MatrixSDK/Crypto/MXCryptoV2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,9 @@ class MXCryptoV2: NSObject, MXCrypto {

if (userId == machine.userId) {
if (machine.crossSigningStatus().hasSelfSigning) {
// if we can cross sign, upload a new signature for that device
// If we can cross sign, upload a new signature for that device
Task {
do {
// This method will always fail if the device belongs to someone else.
// XXX Should update API? and remove the userId?
try await machine.verifyDevice(userId: userId, deviceId: deviceId)
log.debug("Successfully marked device as verified")
await MainActor.run {
Expand Down Expand Up @@ -430,7 +428,6 @@ class MXCryptoV2: NSObject, MXCrypto {
do {
try machine.setLocalTrust(userId: userId, deviceId: deviceId, trust: localTrust)
log.debug("Successfully set local trust to \(localTrust)")
// XXX: Why no MainActor.run here?
success?()
} catch {
log.error("Failed setting local trust", context: error)
Expand Down

0 comments on commit 4ce13d2

Please sign in to comment.