|
|
|
|
|
|
|
|
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"];
|
|
|
|
|
|
id textColor;
|
|
|
|
|
|
|
|
|
|
|
|
if (isNightMode) {
|
|
|
|
|
|
textColor = [[themeManager nightTheme] bodyTextColor];
|
|
|
|
|
|
} else{
|
|
|
|
|
|
textColor = [[themeManager dayTheme] bodyTextColor];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
NSArray* appVersion = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."];
|
|
|
|
|
|
|
|
|
|
|
|
id themeManager;
|
|
|
|
|
|
id isNightMode;
|
|
|
|
|
|
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) {
|
|
|
|
|
|
textColor = [[themeManager nightTheme] bodyTextColor];
|
|
|
|
|
|
} else{
|
|
|
|
|
|
textColor = [[themeManager dayTheme] bodyTextColor];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
|
|
|
|
|
|
[bodyMutableAttributedText beginEditing];
|
|
|
[bodyMutableAttributedText beginEditing];
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
} else if (error != nil || data == nil){
|
|
|
} else if (error != nil || data == nil){
|
|
|
body = @"[an error occured]";
|
|
|
body = @"[an error occured]";
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NSArray* appVersion = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."];
|
|
|
|
|
|
|
|
|
id themeManager = [[%c(ThemeManager) alloc] initWithTraitCollection:nil appSettings:[%c(AppSettings) sharedSettings]];
|
|
|
|
|
|
id isNightMode = [[[%c(AccountManager) sharedManager] defaults] objectForKey:@"kUseNightKey"];
|
|
|
|
|
|
|
|
|
id themeManager;
|
|
|
|
|
|
id isNightMode;
|
|
|
id textColor;
|
|
|
id textColor;
|
|
|
|
|
|
|
|
|
if (isNightMode) {
|
|
|
|
|
|
textColor = [[themeManager nightTheme] bodyTextColor];
|
|
|
|
|
|
} else{
|
|
|
|
|
|
textColor = [[themeManager dayTheme] bodyTextColor];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
|
textColor = [[themeManager nightTheme] bodyTextColor];
|
|
|
|
|
|
} else{
|
|
|
|
|
|
textColor = [[themeManager dayTheme] bodyTextColor];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
NSMutableAttributedString *bodyMutableAttributedText = [[NSMutableAttributedString alloc] initWithAttributedString:[%c(NSAttributedStringMarkdownParser) attributedStringUsingCurrentConfig:body]];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[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];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[request release];
|
|
|
[request release];
|
|
|
[queue release];
|
|
|
[queue release];
|
|
|
[bodyMutableAttributedText release];
|
|
|
[bodyMutableAttributedText release];
|