Console: rename "Hide redacted information" option with "Hide redactions".

+ Turn it ON by default.
This commit is contained in:
giomfo 2015-02-20 14:43:11 +01:00
parent 26adba9017
commit 30ea2b0d8d
6 changed files with 20 additions and 20 deletions

View file

@ -879,7 +879,7 @@ static MatrixSDKHandler *sharedHandler = nil;
if (isRedacted) {
NSLog(@"Redacted event %@ (%@)", event.description, event.redactedBecause);
// Check whether redacted information is required
if (!isSubtitle && ![AppSettings sharedSettings].hideRedactedInformation) {
if (!isSubtitle && ![AppSettings sharedSettings].hideRedactions) {
redactedInfo = @"<redacted>";
// Consider live room state to resolve redactor name if no roomState is provided
MXRoomState *aRoomState = roomState ? roomState : [self.mxSession roomWithRoomId:event.roomId].state;

View file

@ -20,7 +20,7 @@
@property (nonatomic) BOOL enableInAppNotifications;
@property (nonatomic) BOOL displayAllEvents;
@property (nonatomic) BOOL hideRedactedInformation;
@property (nonatomic) BOOL hideRedactions;
@property (nonatomic) BOOL hideUnsupportedEvents;
@property (nonatomic) BOOL sortMembersUsingLastSeenTime;
@property (nonatomic) BOOL displayLeftUsers;

View file

@ -50,7 +50,7 @@ static AppSettings *sharedSettings = nil;
- (void)reset {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"enableInAppNotifications"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"displayAllEvents"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"hideRedactedInformation"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"hideRedactions"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"hideUnsupportedEvents"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"sortMembersUsingLastSeenTime"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"displayLeftUsers"];
@ -80,12 +80,12 @@ static AppSettings *sharedSettings = nil;
[[MatrixSDKHandler sharedHandler] reload:NO];
}
- (BOOL)hideRedactedInformation {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideRedactedInformation"];
- (BOOL)hideRedactions {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideRedactions"];
}
- (void)setHideRedactedInformation:(BOOL)hideRedactedInformation {
[[NSUserDefaults standardUserDefaults] setBool:hideRedactedInformation forKey:@"hideRedactedInformation"];
- (void)setHideRedactions:(BOOL)hideRedactions {
[[NSUserDefaults standardUserDefaults] setBool:hideRedactions forKey:@"hideRedactions"];
}
- (BOOL)hideUnsupportedEvents {

View file

@ -242,7 +242,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
_messagesListener = nil;
[self.mxRoom removeListener:_redactionListener];
_redactionListener = nil;
[[AppSettings sharedSettings] removeObserver:self forKeyPath:@"hideRedactedInformation"];
[[AppSettings sharedSettings] removeObserver:self forKeyPath:@"hideRedactions"];
[[AppSettings sharedSettings] removeObserver:self forKeyPath:@"hideUnsupportedEvents"];
[[MatrixSDKHandler sharedHandler] removeObserver:self forKeyPath:@"isActivityInProgress"];
}
@ -631,7 +631,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
_messagesListener = nil;
[self.mxRoom removeListener:_redactionListener];
_redactionListener = nil;
[[AppSettings sharedSettings] removeObserver:self forKeyPath:@"hideRedactedInformation"];
[[AppSettings sharedSettings] removeObserver:self forKeyPath:@"hideRedactions"];
[[AppSettings sharedSettings] removeObserver:self forKeyPath:@"hideUnsupportedEvents"];
[[MatrixSDKHandler sharedHandler] removeObserver:self forKeyPath:@"isActivityInProgress"];
}
@ -688,7 +688,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
messages = [NSMutableArray array];
}
[[AppSettings sharedSettings] addObserver:self forKeyPath:@"hideRedactedInformation" options:0 context:nil];
[[AppSettings sharedSettings] addObserver:self forKeyPath:@"hideRedactions" options:0 context:nil];
[[AppSettings sharedSettings] addObserver:self forKeyPath:@"hideUnsupportedEvents" options:0 context:nil];
[mxHandler addObserver:self forKeyPath:@"isActivityInProgress" options:0 context:nil];
// Register a listener to handle messages
@ -1031,7 +1031,7 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
self.messagesTableView.contentInset = insets;
_controlViewBottomConstraint.constant = newConstant;
}
} else if ([@"hideUnsupportedEvents" isEqualToString:keyPath] || [@"hideRedactedInformation" isEqualToString:keyPath]) {
} else if ([@"hideUnsupportedEvents" isEqualToString:keyPath] || [@"hideRedactions" isEqualToString:keyPath]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self configureView];
});

View file

@ -37,7 +37,7 @@
#define SETTINGS_SECTION_COUNT 6
#define SETTINGS_SECTION_ROOMS_DISPLAY_ALL_EVENTS_INDEX 0
#define SETTINGS_SECTION_ROOMS_HIDE_REDACTED_INFO_INDEX 1
#define SETTINGS_SECTION_ROOMS_HIDE_REDACTIONS_INDEX 1
#define SETTINGS_SECTION_ROOMS_HIDE_UNSUPPORTED_EVENTS_INDEX 2
#define SETTINGS_SECTION_ROOMS_SORT_MEMBERS_INDEX 3
#define SETTINGS_SECTION_ROOMS_DISPLAY_LEFT_MEMBERS_INDEX 4
@ -96,7 +96,7 @@ NSString* const kCommandsDescriptionText = @"The following commands are availabl
// Rooms settings
UISwitch *allEventsSwitch;
UISwitch *redactedInfoSwitch;
UISwitch *redactionsSwitch;
UISwitch *unsupportedEventsSwitch;
UISwitch *sortMembersSwitch;
UISwitch *displayLeftMembersSwitch;
@ -663,8 +663,8 @@ NSString* const kCommandsDescriptionText = @"The following commands are availabl
[self.tableView reloadData];
} else if (sender == allEventsSwitch) {
[AppSettings sharedSettings].displayAllEvents = allEventsSwitch.on;
} else if (sender == redactedInfoSwitch) {
[AppSettings sharedSettings].hideRedactedInformation = redactedInfoSwitch.on;
} else if (sender == redactionsSwitch) {
[AppSettings sharedSettings].hideRedactions = redactionsSwitch.on;
} else if (sender == unsupportedEventsSwitch) {
[AppSettings sharedSettings].hideUnsupportedEvents = unsupportedEventsSwitch.on;
} else if (sender == sortMembersSwitch) {
@ -982,10 +982,10 @@ NSString* const kCommandsDescriptionText = @"The following commands are availabl
roomsSettingCell.settingLabel.text = @"Display all events";
roomsSettingCell.settingSwitch.on = [[AppSettings sharedSettings] displayAllEvents];
allEventsSwitch = roomsSettingCell.settingSwitch;
} else if (indexPath.row == SETTINGS_SECTION_ROOMS_HIDE_REDACTED_INFO_INDEX) {
} else if (indexPath.row == SETTINGS_SECTION_ROOMS_HIDE_REDACTIONS_INDEX) {
roomsSettingCell.settingLabel.text = @"Hide redactions";
roomsSettingCell.settingSwitch.on = [[AppSettings sharedSettings] hideRedactedInformation];
redactedInfoSwitch = roomsSettingCell.settingSwitch;
roomsSettingCell.settingSwitch.on = [[AppSettings sharedSettings] hideRedactions];
redactionsSwitch = roomsSettingCell.settingSwitch;
} else if (indexPath.row == SETTINGS_SECTION_ROOMS_HIDE_UNSUPPORTED_EVENTS_INDEX) {
roomsSettingCell.settingLabel.text = @"Hide unsupported events";
roomsSettingCell.settingSwitch.on = [[AppSettings sharedSettings] hideUnsupportedEvents];

View file

@ -16,8 +16,8 @@
<false/>
<key>displayAllEvents</key>
<false/>
<key>hideRedactedInformation</key>
<false/>
<key>hideRedactions</key>
<true/>
<key>hideUnsupportedEvents</key>
<true/>
<key>sortMembersUsingLastSeenTime</key>