Skip to content

Commit 58506a7

Browse files
committed
feat: confirm changing theme
1 parent 34aaa16 commit 58506a7

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ $(TWEAK_NAME)_FRAMEWORKS = UIKit Foundation CoreGraphics Photos CoreServices Sys
1111
$(TWEAK_NAME)_PRIVATE_FRAMEWORKS = Preferences
1212
$(TWEAK_NAME)_EXTRA_FRAMEWORKS = Cephei CepheiPrefs CepheiUI
1313
$(TWEAK_NAME)_CFLAGS = -fobjc-arc -Wno-unsupported-availability-guard -Wno-unused-value -Wno-deprecated-declarations -Wno-nullability-completeness -Wno-unused-function -Wno-incompatible-pointer-types
14+
$(TWEAK_NAME)_LOGOSFLAGS = --c warnings=none
1415

1516
CCFLAGS += -std=c++11
1617

src/Controllers/SettingsViewController.m

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ - (NSArray *)specifiers {
114114
[self newSwitchCellWithTitle:@"Confirm voice messages" detailTitle:@"Shows an alert to confirm before sending a voice message" key:@"voice_message_confirm" defaultValue:true changeAction:nil],
115115
[self newSwitchCellWithTitle:@"Confirm sticker interaction" detailTitle:@"Shows an alert when you click a sticker on someone's story to confirm the action" key:@"sticker_interact_confirm" defaultValue:false changeAction:nil],
116116
[self newSwitchCellWithTitle:@"Confirm posting comment" detailTitle:@"Shows an alert when you click the post comment button to confirm" key:@"post_comment_confirm" defaultValue:false changeAction:nil],
117+
[self newSwitchCellWithTitle:@"Confirm changing theme" detailTitle:@"Shows an alert when you change a dm channel theme to confirm" key:@"change_direct_theme_confirm" defaultValue:false changeAction:nil],
117118

118119
// Section 4: Save media
119120
[self newSectionWithTitle:@"Save media" footer:nil],
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#import "../../InstagramHeaders.h"
2+
#import "../../Manager.h"
3+
#import "../../Utils.h"
4+
5+
%hook IGDirectThreadThemePickerViewController
6+
- (void)themeNewPickerSectionController:(id)arg1 didSelectTheme:(id)arg2 atIndex:(NSInteger)arg3 {
7+
if ([SCIManager changeDirectThemeConfirmation]) {
8+
NSLog(@"[SCInsta] Confirm change direct theme triggered");
9+
10+
[SCIUtils showConfirmation:^(void) { %orig; }];
11+
} else {
12+
return %orig;
13+
}
14+
}
15+
- (void)themePickerSectionController:(id)arg1 didSelectThemeId:(id)arg2 {
16+
if ([SCIManager changeDirectThemeConfirmation]) {
17+
NSLog(@"[SCInsta] Confirm change direct theme triggered");
18+
19+
[SCIUtils showConfirmation:^(void) { %orig; }];
20+
} else {
21+
return %orig;
22+
}
23+
}
24+
%end

src/Manager.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
+ (BOOL)voiceMessageConfirmation;
1919
+ (BOOL)stickerInteractConfirmation;
2020
+ (BOOL)postCommentConfirmation;
21+
+ (BOOL)changeDirectThemeConfirmation;
2122
+ (BOOL)copyDecription;
2223
+ (BOOL)hideReelsTab;
2324
+ (BOOL)noRecentSearches;

src/Manager.m

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ + (BOOL)stickerInteractConfirmation {
4747
+ (BOOL)postCommentConfirmation {
4848
return [[NSUserDefaults standardUserDefaults] boolForKey:@"post_comment_confirm"];
4949
}
50+
+ (BOOL)changeDirectThemeConfirmation {
51+
return [[NSUserDefaults standardUserDefaults] boolForKey:@"change_direct_theme_confirm"];
52+
}
5053
+ (BOOL)copyDecription {
5154
return [[NSUserDefaults standardUserDefaults] boolForKey:@"copy_description"];
5255
}

0 commit comments

Comments
 (0)