Skip to content

Commit

Permalink
Oops, NightShift control got stuck on
Browse files Browse the repository at this point in the history
  • Loading branch information
Sticktron committed Mar 24, 2017
1 parent a7c16f3 commit db819ff
Showing 2 changed files with 23 additions and 16 deletions.
37 changes: 22 additions & 15 deletions DarkMessages_SB.xm
Original file line number Diff line number Diff line change
@@ -78,24 +78,31 @@ static void handleRelaunchMobileSMS(CFNotificationCenterRef center, void *observ

%hook CBBlueLightClient
- (BOOL)setEnabled:(BOOL)enabled {
DebugLog(@"BL turning %@", enabled?@"ON":@"OFF");

BOOL result = %orig;
DebugLog(@"result = %d", result);

if (dmc) [dmc setDarkMode:enabled];
if (dmc && dmc.nightShiftControlEnabled) {
BOOL result = %orig;
DebugLog(@"BL turning %@", enabled?@"ON":@"OFF");
DebugLog(@"result = %d", result);

[dmc setDarkMode:enabled];

return result;
} else {
return %orig;
}

return result;
}
- (BOOL)setEnabled:(BOOL)enabled withOption:(int)option {
DebugLog(@"BL turning %@ (with option: %d)", enabled?@"ON":@"OFF", option);

BOOL result = %orig;
DebugLog(@"result = %d", result);

if (dmc) [dmc setDarkMode:enabled];

return result;
if (dmc && dmc.nightShiftControlEnabled) {
BOOL result = %orig;
DebugLog(@"BL turning %@ (with option: %d)", enabled?@"ON":@"OFF", option);
DebugLog(@"result = %d", result);

[dmc setDarkMode:enabled];

return result;
} else {
return %orig;
}
}
%end

2 changes: 1 addition & 1 deletion layout/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: com.sticktron.darkmessages
Name: DarkMessages Beta (iOS 10)
Depends: firmware (>= 10.0), mobilesubstrate, preferenceloader
Version: 1.1.3~b5
Version: 1.1.3~b5-1
Architecture: iphoneos-arm
Description: Dark mode for the Messages app.
[Change Log]

0 comments on commit db819ff

Please sign in to comment.