User directory: Make sure a valid MXSession is provided to ContactsDataSource

https://github.com/vector-im/riot-meta/issues/95
This commit is contained in:
manuroe
2017-07-28 15:02:11 +02:00
parent dd5079aa9a
commit ab629bae99
5 changed files with 22 additions and 20 deletions
+12 -12
View File
@@ -74,17 +74,6 @@
// Assign itself as delegate
self.contactsTableViewControllerDelegate = self;
// Prepare its data source
ContactsDataSource *dataSource = [[ContactsDataSource alloc] init];
dataSource.areSectionsShrinkable = YES;
dataSource.displaySearchInputInContactsList = YES;
dataSource.forceMatrixIdInDisplayName = YES;
// Add a plus icon to the contact cell when a search session is in progress,
// in order to make it more understandable for the end user.
dataSource.contactCellAccessoryImage = [UIImage imageNamed:@"plus_icon"];
[self displayList:dataSource];
}
- (void)viewDidLoad
@@ -121,7 +110,18 @@
{
[self addMatrixSession:mxSession];
}
// Prepare its data source
ContactsDataSource *dataSource = [[ContactsDataSource alloc] initWithMatrixSession:self.mainSession]; // TO TEST
dataSource.areSectionsShrinkable = YES;
dataSource.displaySearchInputInContactsList = YES;
dataSource.forceMatrixIdInDisplayName = YES;
// Add a plus icon to the contact cell when a search session is in progress,
// in order to make it more understandable for the end user.
dataSource.contactCellAccessoryImage = [UIImage imageNamed:@"plus_icon"];
[self displayList:dataSource];
cancelBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onButtonPressed:)];
self.navigationItem.leftBarButtonItem = cancelBarButtonItem;