BuildSettings: Add options for Room directory

This commit is contained in:
manuroe
2020-07-31 15:14:26 +02:00
parent d2bba7c293
commit fbf8ed83b6
2 changed files with 12 additions and 3 deletions
@@ -424,7 +424,8 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
conversationSection = sectionsCount++;
}
if (_recentsDataSourceMode == RecentsDataSourceModeRooms)
if (_recentsDataSourceMode == RecentsDataSourceModeRooms
&& BuildSettings.showPublicRoomDirectory)
{
// Add the directory section after "ROOMS"
directorySection = sectionsCount++;
@@ -512,7 +513,9 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
{
return 0.0;
}
else if (section == directorySection && !(shrinkedSectionsBitMask & RECENTSDATASOURCE_SECTION_DIRECTORY))
else if (section == directorySection
&& !(shrinkedSectionsBitMask & RECENTSDATASOURCE_SECTION_DIRECTORY)
&& BuildSettings.allowRoomDirectoryServersChange)
{
return RECENTSDATASOURCE_DIRECTORY_SECTION_HEADER_HEIGHT;
}
@@ -761,7 +764,10 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
[sectionHeader addSubview:headerLabel];
sectionHeader.headerLabel = headerLabel;
if (section == directorySection && _recentsDataSourceMode == RecentsDataSourceModeRooms && !(shrinkedSectionsBitMask & RECENTSDATASOURCE_SECTION_DIRECTORY))
if (section == directorySection
&& _recentsDataSourceMode == RecentsDataSourceModeRooms
&& !(shrinkedSectionsBitMask & RECENTSDATASOURCE_SECTION_DIRECTORY)
&& BuildSettings.allowRoomDirectoryServersChange)
{
if (!directorySectionContainer)
{