Registration support - Room Members: Use MXTools method to validate email address.

This commit is contained in:
giomfo
2016-03-29 17:08:26 +02:00
parent 95a97b0db4
commit 236d202142
@@ -705,8 +705,7 @@
NSString *participantId = contact.displayName;
// Is it an email or a Matrix user ID?
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^\\S+@\\S+\\.\\S+$" options:NSRegularExpressionCaseInsensitive error:nil];
BOOL isEmailAddress = (nil != [regex firstMatchInString:participantId options:0 range:NSMakeRange(0, participantId.length)]);
BOOL isEmailAddress = [MXTools isEmailAddress:participantId];
// Sanity check the input
if (!isEmailAddress &&