mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-01 05:36:57 +02:00
Public rooms search: Do a AND search on public rooms
This commit is contained in:
@@ -124,15 +124,21 @@ double const kPublicRoomsDirectoryDataExpiration = 10;
|
||||
{
|
||||
if ([filteredRooms indexOfObjectIdenticalTo:publicRoom] == NSNotFound)
|
||||
{
|
||||
// Do a OR search
|
||||
// Do a AND search
|
||||
BOOL matchAll = YES;
|
||||
for (NSString *pattern in _searchPatternsList)
|
||||
{
|
||||
if ([publicRoom.displayname rangeOfString:pattern options:NSCaseInsensitiveSearch].location != NSNotFound)
|
||||
if (pattern.length && NO == [publicRoom.displayname localizedCaseInsensitiveContainsString:pattern])
|
||||
{
|
||||
[filteredRooms addObject:publicRoom];
|
||||
matchAll = NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchAll)
|
||||
{
|
||||
[filteredRooms addObject:publicRoom];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user