Skip to content

Commit

Permalink
review use array last for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Apr 15, 2024
1 parent a5d4d1c commit afd6dee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Riot/Modules/Analytics/DecryptionFailureTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ class DecryptionFailureTracker: NSObject {
failure.eventLocalAgeMillis = Int(exactly: eventRelativeAgeMillis)
failure.trustOwnIdentityAtTimeOfFailure = isSessionVerified

let myDomain = userId.components(separatedBy: ":")[1]
let myDomain = userId.components(separatedBy: ":").last
failure.isMatrixOrg = myDomain == "matrix.org"

if MXTools.isMatrixUserIdentifier(event.sender) {
let senderDomain = event.sender.components(separatedBy: ":")[1]
failure.isFederated = senderDomain != myDomain
let senderDomain = event.sender.components(separatedBy: ":").last
failure.isFederated = senderDomain != nil && senderDomain != myDomain
}

/// XXX for future work, as for now only the event formatter reports UTDs. That means that it's only UTD ~visible to users
Expand Down

0 comments on commit afd6dee

Please sign in to comment.