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:
giomfo
2016-06-14 22:25:10 +02:00
parent 39dfb6ccd5
commit d5b81e3936
12 changed files with 282 additions and 56 deletions
@@ -31,6 +31,7 @@
#import "InviteRecentTableViewCell.h"
#import "DirectoryRecentTableViewCell.h"
#import "RoomIdOrAliasTableViewCell.h"
#import "AppDelegate.h"
@@ -630,6 +631,18 @@
// Show the directory screen
[homeViewController showPublicRoomsDirectory];
}
else if ([cell isKindOfClass:[RoomIdOrAliasTableViewCell class]])
{
NSString *roomIdOrAlias = ((RoomIdOrAliasTableViewCell*)cell).titleLabel.text;
if (roomIdOrAlias.length)
{
// Open the room or preview it
NSString *fragment = [NSString stringWithFormat:@"/room/%@", [roomIdOrAlias stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[AppDelegate theDelegate] handleUniversalLinkFragment:fragment];
}
[tableView deselectRowAtIndexPath:indexPath animated:NO];
}
else
{
[super tableView:tableView didSelectRowAtIndexPath:indexPath];