mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
#40: Add basic AuthenticationService and missing UI tests.
* Add MockAuthenticationService and ServerSelectionUITests. * Add tests covering the Authentication flow.
This commit is contained in:
@@ -31,4 +31,12 @@ extension String {
|
||||
|
||||
return string
|
||||
}
|
||||
|
||||
/// Whether or not the string is a Matrix user ID.
|
||||
var isMatrixUserID: Bool {
|
||||
let range = NSRange(location: 0, length: count)
|
||||
|
||||
let detector = try? NSRegularExpression(pattern: MatrixEntityRegex.userId.rawValue, options: .caseInsensitive)
|
||||
return detector?.numberOfMatches(in: self, range: range) ?? 0 == 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user