Unverified Commit db92fb4f authored by SBiOSoftWhare's avatar SBiOSoftWhare Committed by GitHub
Browse files

Merge pull request #4244 from vector-im/fix_public_search

PublicRoomsDirectoryDataSource: Fix search when NSFW filter is off
parents 2cfe9441 873aa9fd
......@@ -9,9 +9,10 @@ Changes to be released in next version
* MasterTabBarController: Show/Hide Home Screen tabs (#4234).
* RoomVC: Enable / Disable VoIP feature in Rooms (#4236).
* UnifiedSearchRecentsDataSource: Show/Hide public directory (#4242).
* DirectoryRecentTableViewCell: Do not use "directory_search_results_more_than" string when there is no rooms and the search is on.
🐛 Bugfix
*
* PublicRoomsDirectoryDataSource: Fix search when NSFW filter is off.
⚠️ API Changes
*
......
......@@ -54,7 +54,7 @@
self.titleLabel.text = NSLocalizedStringFromTable(@"directory_search_results_title", @"Vector", nil);
// Do we need to display like ">20 results found" or "18 results found"?
NSString *descriptionLabel = publicRoomsDirectoryDataSource.moreThanRoomsCount ? NSLocalizedStringFromTable(@"directory_search_results_more_than", @"Vector", nil) : NSLocalizedStringFromTable(@"directory_search_results", @"Vector", nil);
NSString *descriptionLabel = (publicRoomsDirectoryDataSource.moreThanRoomsCount && publicRoomsDirectoryDataSource.roomsCount > 0) ? NSLocalizedStringFromTable(@"directory_search_results_more_than", @"Vector", nil) : NSLocalizedStringFromTable(@"directory_search_results", @"Vector", nil);
self.descriptionLabel.text = [NSString stringWithFormat:descriptionLabel,
publicRoomsDirectoryDataSource.roomsCount,
......
......@@ -261,7 +261,7 @@ static NSString *const kNSFWKeyword = @"nsfw";
[self->rooms addObjectsFromArray:publicRooms];
self->nextBatch = publicRoomsResponse.nextBatch;
if (!self->_searchPattern || !self.showNSFWRooms)
if (!self->_searchPattern)
{
// When there is no search, we can use totalRoomCountEstimate returned by the server
self->_roomsCount = publicRoomsResponse.totalRoomCountEstimate;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment