Browse Source

Fix Apollo crash on 1.10.9

pull/10/head
IntriguingTiles 3 years ago
parent
commit
bc2ce3915b
2 changed files with 13 additions and 2 deletions
  1. +1
    -0
      tweak/Apollo.h
  2. +12
    -2
      tweak/Apollo.xm

+ 1
- 0
tweak/Apollo.h View File

@interface MarkdownRenderer @interface MarkdownRenderer
+ (id)attributedStringFromMarkdown:(id)arg1 withAttributes:(id)arg2; + (id)attributedStringFromMarkdown:(id)arg1 withAttributes:(id)arg2;
+ (id)attributedStringFromMarkdown:(id)arg1 withAttributes:(id)arg2 isForPreview:(BOOL)arg3;
@end @end
@interface ActionController @interface ActionController

+ 12
- 2
tweak/Apollo.xm View File

NSAttributedString *newAuthorAttributedString = [[NSAttributedString alloc] initWithString:author attributes:authorStringAttributes]; NSAttributedString *newAuthorAttributedString = [[NSAttributedString alloc] initWithString:author attributes:authorStringAttributes];
[authorNode setAttributedTitle:newAuthorAttributedString forState:UIControlStateNormal]; [authorNode setAttributedTitle:newAuthorAttributedString forState:UIControlStateNormal];
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes]];
@try {
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes]];
}
@catch (NSException *exc) {
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes isForPreview:NO]];
}
if ([data objectForKey:@"sender"]) { if ([data objectForKey:@"sender"]) {
[data[@"sender"] setEnabled:YES]; [data[@"sender"] setEnabled:YES];
NSAttributedString* newAuthorAttributedString = [[NSAttributedString alloc] initWithString:authorTextString attributes:authorStringAttributes]; NSAttributedString* newAuthorAttributedString = [[NSAttributedString alloc] initWithString:authorTextString attributes:authorStringAttributes];
[authorNode setAttributedTitle:newAuthorAttributedString forState:UIControlStateNormal]; [authorNode setAttributedTitle:newAuthorAttributedString forState:UIControlStateNormal];
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes]];
@try {
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes]];
}
@catch (NSException *exc) {
[bodyNode setAttributedString:[%c(MarkdownRenderer) attributedStringFromMarkdown:body withAttributes:apolloBodyAttributes isForPreview:NO]];
}
} }
%end %end

Loading…
Cancel
Save