mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
Room creation: Fix Alias and Participants handling in Home screen
This commit is contained in:
@@ -187,7 +187,7 @@
|
||||
|
||||
- (void)textFieldDidEndEditing:(UITextField *)textField {
|
||||
if (textField == _roomAliasTextField) {
|
||||
// Compute the new phone number with this string change
|
||||
// Compute the new alias with this string change
|
||||
NSString * alias = textField.text;
|
||||
if (alias.length) {
|
||||
// add homeserver as suffix
|
||||
@@ -213,7 +213,9 @@
|
||||
participants = [participants stringByAppendingString:@" @"];
|
||||
} else if ([string isEqualToString:@":"]) {
|
||||
// Add homeserver
|
||||
participants = [participants stringByAppendingString:[MatrixHandler sharedHandler].homeServer];
|
||||
if ([MatrixHandler sharedHandler].homeServer) {
|
||||
participants = [participants stringByAppendingString:[MatrixHandler sharedHandler].homeServer];
|
||||
}
|
||||
}
|
||||
|
||||
textField.text = participants;
|
||||
|
||||
@@ -203,7 +203,13 @@ NSString* const defaultHomeserver = @"http://matrix.org";
|
||||
// Report credentials
|
||||
[matrix setUserId:credentials.userId];
|
||||
[matrix setAccessToken:credentials.accessToken];
|
||||
[matrix setHomeServer:credentials.homeServer];
|
||||
// Extract homeServer name from userId
|
||||
NSArray *components = [credentials.userId componentsSeparatedByString:@":"];
|
||||
if (components.count == 2) {
|
||||
[matrix setHomeServer:[components lastObject]];
|
||||
} else {
|
||||
NSLog(@"Unexpected error: the userId is not correctly formatted: %@", credentials.userId);
|
||||
}
|
||||
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user