mirror of
https://github.com/lint/TFDidThatSay
synced 2025-07-04 16:36:46 +00:00
Add support for Reddit 4.45.0 update
This commit is contained in:
2
control
2
control
@ -1,7 +1,7 @@
|
|||||||
Package: com.lint.undelete
|
Package: com.lint.undelete
|
||||||
Name: TFDidThatSay?
|
Name: TFDidThatSay?
|
||||||
Depends: mobilesubstrate
|
Depends: mobilesubstrate
|
||||||
Version: 1.2.3
|
Version: 1.2.4
|
||||||
Architecture: iphoneos-arm
|
Architecture: iphoneos-arm
|
||||||
Description: See "[deleted]" comments and posts without leaving Reddit!
|
Description: See "[deleted]" comments and posts without leaving Reddit!
|
||||||
Maintainer: lint <apieceoflint@protonmail.com>
|
Maintainer: lint <apieceoflint@protonmail.com>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
//custom element
|
//custom element
|
||||||
@property(strong,nonatomic) id undeleteButton;
|
@property(strong,nonatomic) id undeleteButton;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* -- Post Interfaces -- */
|
/* -- Post Interfaces -- */
|
||||||
|
@ -107,6 +107,13 @@
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@interface ThemeManager
|
@interface ThemeManager
|
||||||
|
|
||||||
|
// >= 4.45.0
|
||||||
|
@property(assign,nonatomic) id darkTheme;
|
||||||
|
@property(assign,nonatomic) id lightTheme;
|
||||||
|
-(id) initWithAppSettings:(id) arg1;
|
||||||
|
|
||||||
|
// < 4.45.0
|
||||||
@property(assign,nonatomic) id dayTheme;
|
@property(assign,nonatomic) id dayTheme;
|
||||||
@property(assign,nonatomic) id nightTheme;
|
@property(assign,nonatomic) id nightTheme;
|
||||||
-(id) initWithTraitCollection:(id) arg1 appSettings:(id) arg2;
|
-(id) initWithTraitCollection:(id) arg1 appSettings:(id) arg2;
|
||||||
|
@ -86,15 +86,33 @@
|
|||||||
body = @"[an error occured]";
|
body = @"[an error occured]";
|
||||||
}
|
}
|
||||||
|
|
||||||
id themeManager = [[%c(ThemeManager) alloc] initWithTraitCollection:nil appSettings:[%c(AppSettings) sharedSettings]];
|
|
||||||
id isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
NSArray* appVersion = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."];
|
||||||
|
|
||||||
|
id themeManager;
|
||||||
|
id isNightMode;
|
||||||
id textColor;
|
id textColor;
|
||||||
|
|
||||||
|
if ([appVersion[1] integerValue] >= 45){
|
||||||
|
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
|
||||||
|
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
|
if (isNightMode) {
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else{
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
themeManager = [[%c(ThemeManager) alloc] initWithTraitCollection:nil appSettings:[%c(AppSettings) sharedSettings]];
|
||||||
|
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
if (isNightMode) {
|
if (isNightMode) {
|
||||||
textColor = [[themeManager nightTheme] bodyTextColor];
|
textColor = [[themeManager nightTheme] bodyTextColor];
|
||||||
} else{
|
} else{
|
||||||
textColor = [[themeManager dayTheme] bodyTextColor];
|
textColor = [[themeManager dayTheme] bodyTextColor];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
||||||
|
|
||||||
@ -204,15 +222,32 @@
|
|||||||
body = @"[an error occured]";
|
body = @"[an error occured]";
|
||||||
}
|
}
|
||||||
|
|
||||||
id themeManager = [[%c(ThemeManager) alloc] initWithTraitCollection:nil appSettings:[%c(AppSettings) sharedSettings]];
|
NSArray* appVersion = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."];
|
||||||
id isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
|
||||||
|
id themeManager;
|
||||||
|
id isNightMode;
|
||||||
id textColor;
|
id textColor;
|
||||||
|
|
||||||
|
if ([appVersion[1] integerValue] >= 45){
|
||||||
|
themeManager = [[%c(ThemeManager) alloc] initWithAppSettings:[%c(AppSettings) sharedSettings]];
|
||||||
|
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
|
if (isNightMode) {
|
||||||
|
textColor = [[themeManager darkTheme] bodyTextColor];
|
||||||
|
} else{
|
||||||
|
textColor = [[themeManager lightTheme] bodyTextColor];
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
themeManager = [[%c(ThemeManager) alloc] initWithTraitCollection:nil appSettings:[%c(AppSettings) sharedSettings]];
|
||||||
|
isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
||||||
|
|
||||||
if (isNightMode) {
|
if (isNightMode) {
|
||||||
textColor = [[themeManager nightTheme] bodyTextColor];
|
textColor = [[themeManager nightTheme] bodyTextColor];
|
||||||
} else{
|
} else{
|
||||||
textColor = [[themeManager dayTheme] bodyTextColor];
|
textColor = [[themeManager dayTheme] bodyTextColor];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
||||||
|
|
||||||
@ -228,7 +263,7 @@
|
|||||||
[post setAuthor:author];
|
[post setAuthor:author];
|
||||||
[post setValue:body forKey:@"selfText"];
|
[post setValue:body forKey:@"selfText"];
|
||||||
|
|
||||||
if ([[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."][1] integerValue] >= 44){
|
if ([appVersion[1] integerValue] >= 44){
|
||||||
[[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] configureSelfTextNode];
|
[[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] contentNode] configureSelfTextNode];
|
||||||
} else {
|
} else {
|
||||||
[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] configureSelfTextNode];
|
[[[[self postActionSheetDelegate] controller] feedPostDetailCellNode] configureSelfTextNode];
|
||||||
|
Reference in New Issue
Block a user