mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-01 13:46:57 +02:00
Room search: search result should include the search pattern when it corresponds to a valid room alias or id.
+ Room search: Room preview should be used when user selects a public room that he did not join yet. https://github.com/vector-im/vector-ios/issues/328 https://github.com/vector-im/vector-ios/issues/329
This commit is contained in:
@@ -107,31 +107,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
// Join the room before opening it
|
||||
[self startActivityIndicator];
|
||||
|
||||
// We promote here join by room alias instead of room id
|
||||
NSString *roomIdOrAlias = publicRoom.roomId;
|
||||
if (publicRoom.aliases.count)
|
||||
{
|
||||
roomIdOrAlias = publicRoom.aliases.firstObject;
|
||||
}
|
||||
|
||||
[dataSource.mxSession joinRoom:roomIdOrAlias success:^(MXRoom *room) {
|
||||
|
||||
[self stopActivityIndicator];
|
||||
|
||||
[self openRoomWithId:publicRoom.roomId inMatrixSession:dataSource.mxSession];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
[self stopActivityIndicator];
|
||||
|
||||
NSLog(@"[DirectoryVC] Failed to join public room (%@)", publicRoom.displayname);
|
||||
|
||||
// Alert user
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
}];
|
||||
// Preview the public room
|
||||
NSString *fragment = [NSString stringWithFormat:@"/room/%@", [publicRoom.roomId stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||
[[AppDelegate theDelegate] handleUniversalLinkFragment:fragment];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user