mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 20:56:57 +02:00
Restore all settings usage.
This commit is contained in:
@@ -95,11 +95,17 @@ static MatrixSDKHandler *sharedHandler = nil;
|
||||
|
||||
_unnotifiedRooms = [[NSMutableArray alloc] init];
|
||||
_partialTextMsgByRoomId = [[NSMutableDictionary alloc] init];
|
||||
|
||||
[[MXKAppSettings standardAppSettings] addObserver:self forKeyPath:@"enableInAppNotifications" options:0 context:nil];
|
||||
[[MXKAppSettings standardAppSettings] addObserver:self forKeyPath:@"showAllEventsInRoomHistory" options:0 context:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[[MXKAppSettings standardAppSettings] removeObserver:self forKeyPath:@"enableInAppNotifications"];
|
||||
[[MXKAppSettings standardAppSettings] removeObserver:self forKeyPath:@"showAllEventsInRoomHistory"];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:reachabilityObserver];
|
||||
reachabilityObserver = nil;
|
||||
@@ -891,4 +897,16 @@ static MatrixSDKHandler *sharedHandler = nil;
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - KVO
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
if ([@"showAllEventsInRoomHistory" isEqualToString:keyPath]) {
|
||||
// Flush and restore Matrix data
|
||||
[self reload:NO];
|
||||
}
|
||||
else if ([@"enableInAppNotifications" isEqualToString:keyPath]) {
|
||||
[self enableInAppNotifications:[[MXKAppSettings standardAppSettings] enableInAppNotifications]];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user