Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fix story seen and story download
Browse files Browse the repository at this point in the history
  • Loading branch information
haoict committed Feb 20, 2021
1 parent 60d79cb commit 6da77a6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
1 change: 1 addition & 0 deletions Tweak.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <dlfcn.h>
#import <Foundation/Foundation.h>
#import <libhdev/HUtilities/HCommon.h>
#import "settingsview/MNASettingsViewController.h"
Expand Down
31 changes: 11 additions & 20 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -359,31 +359,22 @@ static void reloadPrefs() {
%end
%end

static id observer;
/**
* Constructor
*/
%ctor {
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback) reloadPrefs, CFSTR(PREF_CHANGED_NOTIF), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
reloadPrefs();

// dlopen([[[NSBundle mainBundle].bundlePath stringByAppendingPathComponent:@"Frameworks/NotInCore.framework/NotInCore"] UTF8String], RTLD_NOW);
observer = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification
object:nil queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *notification) {
%init(CommonGroup);
%init(NoAdsNoStoriesRow);
%init(DisableReadReceipt);
%init(DisableTypingIndicator);
%init(DisableStorySeenReceipt);
%init(CanSaveFriendsStory);
%init(HideSearchBar);
%init(HidePeopleTab);
%init(ExtendStoryVideoUploadLength);
}
];
}

%dtor {
[[NSNotificationCenter defaultCenter] removeObserver:observer];
dlopen([[[NSBundle mainBundle].bundlePath stringByAppendingPathComponent:@"Frameworks/NotInCore.framework/NotInCore"] UTF8String], RTLD_NOW);

%init(CommonGroup);
%init(NoAdsNoStoriesRow);
%init(DisableReadReceipt);
%init(DisableTypingIndicator);
%init(DisableStorySeenReceipt);
%init(CanSaveFriendsStory);
%init(HideSearchBar);
%init(HidePeopleTab);
%init(ExtendStoryVideoUploadLength);
}
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: com.haoict.messengernoads
Name: Messenger No Ads
Depends: mobilesubstrate, com.haoict.libhdev (>= 4.5.0), firmware (>= 10)
Version: 3.9.0
Version: 3.9.1
Architecture: iphoneos-arm
Description: The best tweak for Messenger app.
The best tweak for Messenger app.
Expand Down

0 comments on commit 6da77a6

Please sign in to comment.