feat: foss merge changes from review

This commit is contained in:
JanNiklas Grabowski
2024-08-20 12:58:18 +02:00
parent eb005301ee
commit a3a9fc2c66
5 changed files with 23 additions and 13 deletions

6
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "matrix-ios-sdk"] # [submodule "matrix-ios-sdk"]
path = matrix-ios-sdk # path = matrix-ios-sdk
url = git@github.com:matrix-org/matrix-ios-sdk.git # url = git@github.com:matrix-org/matrix-ios-sdk.git

View File

@@ -764,4 +764,10 @@ class BWIBuildSettings: NSObject {
// MARK: Change Password // MARK: Change Password
var showPasswordRequirements = false var showPasswordRequirements = false
// MARK: Report Room
var showReportRoomButton = false
// MARK: Enable NSFW filter
var enableNSFWFilter = false
} }

View File

@@ -339,15 +339,16 @@ static NSString *const kNSFWKeyword = @"nsfw";
for (MXPublicRoom *publicRoom in publicRooms) for (MXPublicRoom *publicRoom in publicRooms)
{ {
BOOL shouldAllow = YES; BOOL shouldAllow = YES;
// BWI: #6076 enable nsfw filtering
if (publicRoom.name != nil) { if (BWIBuildSettings.shared.enableNSFWFilter) {
shouldAllow &= [self.forbiddenTermsRegex numberOfMatchesInString:publicRoom.name options:0 range:NSMakeRange(0, publicRoom.name.length)] == 0; if (publicRoom.name != nil) {
shouldAllow &= [self.forbiddenTermsRegex numberOfMatchesInString:publicRoom.name options:0 range:NSMakeRange(0, publicRoom.name.length)] == 0;
}
if (publicRoom.topic != nil) {
shouldAllow &= [self.forbiddenTermsRegex numberOfMatchesInString:publicRoom.topic options:0 range:NSMakeRange(0, publicRoom.topic.length)] == 0;
}
} }
if (publicRoom.topic != nil) {
shouldAllow &= [self.forbiddenTermsRegex numberOfMatchesInString:publicRoom.topic options:0 range:NSMakeRange(0, publicRoom.topic.length)] == 0;
}
if (shouldAllow) { if (shouldAllow) {
[filteredRooms addObject:publicRoom]; [filteredRooms addObject:publicRoom];
} }

View File

@@ -280,7 +280,11 @@ final class RoomInfoListViewController: UIViewController {
tmpSections.append(sectionSettings) tmpSections.append(sectionSettings)
tmpSections.append(sectionLeave) tmpSections.append(sectionLeave)
tmpSections.append(sectionReport)
// BWI: #6076 we do not support the report function yet
if BWIBuildSettings.shared.showReportRoomButton {
tmpSections.append(sectionReport)
}
sections = tmpSections sections = tmpSections
} }

View File

@@ -215,7 +215,6 @@ typedef NS_ENUM(NSUInteger, ABOUT)
ABOUT_IMPRINT_INDEX, ABOUT_IMPRINT_INDEX,
ABOUT_THIRD_PARTY_INDEX, ABOUT_THIRD_PARTY_INDEX,
ABOUT_SUPPORT_INDEX, ABOUT_SUPPORT_INDEX,
ABOUT_SHOW_NSFW_ROOMS_INDEX,
ABOUT_CRASH_REPORT_INDEX, ABOUT_CRASH_REPORT_INDEX,
ABOUT_ENABLE_RAGESHAKE_INDEX, ABOUT_ENABLE_RAGESHAKE_INDEX,
ABOUT_MARK_ALL_AS_READ_INDEX, ABOUT_MARK_ALL_AS_READ_INDEX,