Merge pull request #1087 from vector-im/msisdn_login

Support msisdn login
This commit is contained in:
giomfo
2017-03-10 14:35:32 +01:00
committed by GitHub
6 changed files with 136 additions and 42 deletions
+16 -1
View File
@@ -1425,7 +1425,22 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)();
// When displaying the textfield the 1st time, open the keyboard
if (!newPhoneNumberCell)
{
newPhoneCell.isoCountryCode = [MXKAppSettings standardAppSettings].phonebookCountryCode;
NSString *countryCode = [MXKAppSettings standardAppSettings].phonebookCountryCode;
if (!countryCode)
{
// If none, consider the preferred locale
NSLocale *local = [[NSLocale alloc] initWithLocaleIdentifier:[[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0]];
if ([local respondsToSelector:@selector(countryCode)])
{
countryCode = local.countryCode;
}
if (!countryCode)
{
countryCode = @"GB";
}
}
newPhoneCell.isoCountryCode = countryCode;
newPhoneCell.mxkTextField.text = nil;
newPhoneNumberCell = newPhoneCell;