Skip to content

Commit

Permalink
feat: follow confirmation on profile follow buttons now only show whi…
Browse files Browse the repository at this point in the history
…le not following

Credit to @xNaifDev for the implementation.
BandarHL@581c0ad
  • Loading branch information
SoCuul committed Mar 31, 2024
1 parent 87e07cd commit 8e5590c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Features/Confirm/FollowConfirm.x
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#import "../../Manager.h"
#import "../../Utils.h"
#import "../../InstagramHeaders.h"

// Follow button on profile page
%hook IGFollowController
- (void)_didPressFollowButton {
// Get user follow status (check if already following user)
NSInteger UserFollowStatus = self.user.followStatus;

if ([BHIManager followConfirmation]) {
NSLog(@"[BHInsta] Confirm follow triggered");

[BHIUtils showConfirmation:^(void) { %orig; }];
// Only show confirm dialog if user is not already following
if (UserFollowStatus == 2) {
[BHIUtils showConfirmation:^(void) { %orig; }];
}
else {
return %orig;
}
} else {
return %orig;
}
Expand Down
1 change: 1 addition & 0 deletions src/InstagramHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
* For HD profile picture
*/
@interface IGUser : NSObject
@property NSInteger followStatus;
@property(copy) NSString *username;
@property BOOL followsCurrentUser;
- (NSURL *)HDProfilePicURL;
Expand Down

0 comments on commit 8e5590c

Please sign in to comment.