Public rooms search: Add an expiration time (10s) on public rooms list data to avoid to make request each time the user enter a new letter

This commit is contained in:
manuroe
2015-12-18 11:41:39 +01:00
parent 76689ada32
commit 21ce23fa8b
4 changed files with 84 additions and 53 deletions
@@ -32,17 +32,21 @@
*/
@interface PublicRoomsDirectoryDataSource : MXKDataSource <UITableViewDataSource, MXKDataSourceDelegate>
/**
All public rooms of the directory.
*/
@property (nonatomic, readonly) NSArray<MXPublicRoom*> *rooms;
/**
The filter being applied. Nil if there is no filter.
Setting a new value may trigger a request to the home server. So, the data source state
may change to MXKDataSourceStatePreparing.
*/
@property (nonatomic) NSString *searchPattern;
@property (nonatomic) NSString *filter;
/**
The public room of the directory.
The returned array is filtered according to `searchPattern`.
Public rooms of the directory that match `filter`.
*/
@property (nonatomic, readonly) NSArray<MXPublicRoom*> *rooms;
@property (nonatomic, readonly) NSArray<MXPublicRoom*> *filteredRooms;
@end