Skip to content

Commit

Permalink
Refactor: Rename download videos to download media
Browse files Browse the repository at this point in the history
  • Loading branch information
SoCuul committed Mar 11, 2024
1 parent 8bc2251 commit 58aa295
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ - (NSArray *)specifiers {

// Section 4: Save media
[self newSectionWithTitle:@"Save media" footer:nil],
[self newSwitchCellWithTitle:@"Download videos" detailTitle:@"Download videos by long press" key:@"dw_videos" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Download images/videos" detailTitle:@"Download images/videos by long press" key:@"dw_videos" defaultValue:true changeAction:nil],
[self newSwitchCellWithTitle:@"Save profile image" detailTitle:@"Save profile image by long press" key:@"save_profile" defaultValue:true changeAction:nil],

// Section 5: Stories and Messages
Expand Down
10 changes: 10 additions & 0 deletions src/Features/General/BHSettingsMenuEntry.x
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#import "../../InstagramHeaders.h"
#import "../../Manager.h"

/* %hook IGProfileHeaderNavigationView
- _rightButtonsLayout.(id)initWithDirection:(NSInteger)arg1 children:(id)arg2 {
return nil;
}
- _rightButtonsLayout.(id).initWithChildren:(id)arg1 {
return nil;
}
%end */

/* Legacy (as of March 8th 2023) */
%hook IGProfileMenuSheetViewController
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 9;
Expand Down
6 changes: 3 additions & 3 deletions src/Features/Save/MediaSave.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%property (nonatomic, strong) JGProgressHUD *hud;
- (id)initWithFrame:(CGRect)arg1 {
id orig = %orig;
if ([BHIManager downloadVideos]) {
if ([BHIManager downloadMedia]) {
[orig addHandleLongPress];
}
return orig;
Expand Down Expand Up @@ -85,7 +85,7 @@
%property (nonatomic, strong) JGProgressHUD *hud;
- (id)initWithFrame:(CGRect)arg1 {
id orig = %orig;
if ([BHIManager downloadVideos]) {
if ([BHIManager downloadMedia]) {
[orig addHandleLongPress];
}
return orig;
Expand Down Expand Up @@ -179,7 +179,7 @@
%property (nonatomic, strong) JGProgressHUD *hud;
- (id)initWithFrame:(CGRect)arg1 {
id orig = %orig;
if ([BHIManager downloadVideos]) {
if ([BHIManager downloadMedia]) {
[orig addHandleLongPress];
}
return orig;
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Save/StoriesSave.x
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
%property (nonatomic, retain) NSString *fileextension;
- (id)initWithFrame:(CGRect)arg1 shouldCreateComposerBackgroundView:(BOOL)arg2 userSession:(id)arg3 bloksContext:(id)arg4 {
self = %orig;
if ([BHIManager downloadVideos]) {
if ([BHIManager downloadMedia]) {
self.hDownloadButton = [UIButton buttonWithType:UIButtonTypeSystem];
[self.hDownloadButton addTarget:self action:@selector(hDownloadButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.hDownloadButton setImage:[UIImage systemImageNamed:@"arrow.down.to.line.circle.fill"] forState:UIControlStateNormal];
Expand Down
2 changes: 1 addition & 1 deletion src/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@interface BHIManager : NSObject

+ (BOOL)hideAds;
+ (BOOL)downloadVideos;
+ (BOOL)downloadMedia;
+ (BOOL)profileImageSave;
+ (BOOL)removeSuggestedPost;
+ (BOOL)removeSuggestedAccounts;
Expand Down
2 changes: 1 addition & 1 deletion src/Manager.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ @implementation BHIManager
+ (BOOL)hideAds {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hide_ads"];
}
+ (BOOL)downloadVideos {
+ (BOOL)downloadMedia {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"dw_videos"];
}
+ (BOOL)profileImageSave {
Expand Down

0 comments on commit 58aa295

Please sign in to comment.