Skip to content

Commit

Permalink
update 2.9.9
Browse files Browse the repository at this point in the history
- Add Status Tweet (vibe)
- Fix bugs and performance improvement
  • Loading branch information
BandarHL committed Aug 2, 2022
1 parent 655450d commit 74bdc45
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 57 deletions.
2 changes: 1 addition & 1 deletion BHTwitter/BHDownloadInlineButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

#import <UIKit/UIKit.h>
#import "TWHeaders.h"
#import "BHTManager.h"

@interface BHDownloadInlineButton : UIButton
{
Expand Down
9 changes: 3 additions & 6 deletions BHTwitter/BHDownloadInlineButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#import "BHDownloadInlineButton.h"
#import "Colours.h"
#import "BHTManager.h"

@interface BHDownloadInlineButton () <BHDownloadDelegate>
@property (nonatomic, strong) JGProgressHUD *hud;
Expand All @@ -20,20 +19,18 @@ + (CGSize)buttonImageSizeUsingViewModel:(id)arg1 options:(unsigned long long)arg


- (void)statusDidUpdate:(id)arg1 options:(unsigned long long)arg2 displayTextOptions:(unsigned long long)arg3 animated:(_Bool)arg4 {
if ([arg1 isKindOfClass:objc_getClass("TFNTwitterStatus")]) {
if ([self.delegate.delegate isKindOfClass:objc_getClass("T1SlideshowStatusView")]) {
[self setTintColor:UIColor.whiteColor];
}
if ([arg1 isKindOfClass:objc_getClass("T1URTTimelineStatusItemViewModel")]) {
} else {
[self setTintColor:[UIColor colorFromHexString:@"6D6E70"]];
}
}
- (id)initWithOptions:(unsigned long long)arg1 overrideSize:(struct CGSize)arg2 account:(id)arg3 {
self = [super initWithFrame:CGRectMake(0, 0, arg2.width, arg2.height)];
if (self != nil) {
[self setDisplayType:1];
[self setInlineActionType:80];
[self setTintColor:[UIColor colorFromHexString:@"6D6E70"]];
[self setImageEdgeInsets:UIEdgeInsetsMake(0, -11, 0, -11)];
// [self setImageEdgeInsets:UIEdgeInsetsMake(0, -11, 0, -11)];
[self setImage:[UIImage systemImageNamed:@"arrow.down"] forState:UIControlStateNormal];
[self addTarget:self action:@selector(DownloadHandler:) forControlEvents:UIControlEventTouchUpInside];
}
Expand Down
23 changes: 6 additions & 17 deletions BHTwitter/BHTwitter.xm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#import "BHDownloadInlineButton.h"
#import "SAMKeychain/AuthViewController.h"
#import "Colours.h"
#import "BHTManager.h"
Expand All @@ -16,10 +15,7 @@
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"hide_promoted"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"voice"];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"undo_tweet"];
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"like_con"];
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"tweet_con"];
[[NSUserDefaults standardUserDefaults] setBool:false forKey:@"direct_save"];
[[NSUserDefaults standardUserDefaults] synchronize];
[[NSUserDefaults standardUserDefaults] setBool:true forKey:@"TrustedFriends"];
}
[BHTManager cleanCache];
if ([BHTManager FLEX]) {
Expand Down Expand Up @@ -707,7 +703,11 @@
}
}

// CoTweet
// MARK: Status tweet
- (BOOL)_t1_isVibeCompositionEnabled {
return true;
}
// MARK: CoTweet
- (BOOL)isTweetCollaborationEnabled {
return true;
}
Expand Down Expand Up @@ -778,17 +778,6 @@
%end

// MARK: Reader mode
%hook TUCLayoutContext
- (BOOL)isReaderModeEnabled {
return true;
}
%end

%hook T1ConversationContainerViewController
- (id)initWithAccount:(id)arg1 viewModel:(id)arg2 statusNavigationContext:(id)arg3 scribeContext:(id)arg4 sourceNavigationMetadata:(id)arg5 overrideNavigationMetadata:(id)arg6 shouldIncludeReferrerParams:(_Bool)arg7 ruxContext:(id)arg8 readerModeEnabled:(_Bool)arg9 {
return %orig(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, [BHTManager ReaderMode]);
}
%end
%hook T1ReaderModeConfig
- (_Bool)isReaderModeEnabled {
if ([BHTManager ReaderMode]) {
Expand Down
2 changes: 1 addition & 1 deletion BHTwitter/Package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.bandarhl.BHTwitter
Name: BHTwitter
Version: 2.9.8
Version: 2.9.9
Description: Awesome tweak for Twitter
Section: Tweaks
Depends: firmware (>= 13.0), mobilesubstrate, ws.hbang.common (>= 1.17)
Expand Down
Loading

0 comments on commit 74bdc45

Please sign in to comment.