Skip to content

Commit

Permalink
fixed a crash
Browse files Browse the repository at this point in the history
closes #12
  • Loading branch information
Alexandra authored and Alexandra committed Sep 8, 2022
1 parent 9d8a8d6 commit 4e6e5b4
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 32 deletions.
8 changes: 4 additions & 4 deletions Preferences/CallaTwitterCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ @implementation CallaTwitterCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

self.leftUserDisplayName = specifier.properties[@"leftUserDisplayName"];
self.leftUserUsername = specifier.properties[@"leftUserUsername"];
self.rightUserDisplayName = specifier.properties[@"rightUserDisplayName"];
self.rightUserUsername = specifier.properties[@"rightUserUsername"];
[self setLeftUserDisplayName:specifier.properties[@"leftUserDisplayName"]];
[self setLeftUserUsername:specifier.properties[@"leftUserUsername"]];
[self setRightUserDisplayName:specifier.properties[@"rightUserDisplayName"]];
[self setRightUserUsername:specifier.properties[@"rightUserUsername"]];

// separator
self.separatorView = [UIView new];
Expand Down
2 changes: 0 additions & 2 deletions Tweak/Settings/Controllers/VeDetailAttachmentListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeDetailAttachmentListController.h"

@implementation VeDetailAttachmentListController

- (void)viewDidLoad {
[super viewDidLoad];

Expand Down Expand Up @@ -67,5 +66,4 @@ - (void)copyAttachment {
- (void)saveAttachment {
UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:[self attachmentData]], nil, nil, nil);
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Controllers/VeDetailMessageListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeDetailMessageListController.h"

@implementation VeDetailMessageListController

- (void)viewDidLoad {
[super viewDidLoad];

Expand Down Expand Up @@ -51,5 +50,4 @@ - (BOOL)shouldReloadSpecifiersOnResume {
- (void)copyMessage {
[[UIPasteboard generalPasteboard] setString:[self message]];
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Controllers/VeDetailViewListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeDetailViewListController.h"

@implementation VeDetailViewListController

- (void)viewDidLoad {
[super viewDidLoad];

Expand Down Expand Up @@ -180,5 +179,4 @@ - (void)deleteLog {

[self dismissViewControllerAnimated:YES completion:nil];
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Controllers/VeLogsListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
NSString* dateFormatValue = @"dd.MM.YYYY";

@implementation VeLogsListController

- (void)viewDidLoad {
[super viewDidLoad];

Expand Down Expand Up @@ -242,5 +241,4 @@ - (void)expandLog:(PSSpecifier *)specifier {
[detailViewListController setNotificationDate:specifier.properties[@"date"]];
[self presentViewController:detailViewListController animated:YES completion:nil];
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Controllers/VePreferencesListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VePreferencesListController.h"

@implementation VePreferencesListController

- (void)viewDidLoad {
[super viewDidLoad];

Expand All @@ -28,5 +27,4 @@ - (void)viewDidLoad {
- (BOOL)shouldReloadSpecifiersOnResume {
return false;
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Custom-Cells/VeDetailAttachmentCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeDetailAttachmentCell.h"

@implementation VeDetailAttachmentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

Expand Down Expand Up @@ -83,5 +82,4 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

return self;
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Custom-Cells/VeDetailCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeDetailCell.h"

@implementation VeDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

Expand Down Expand Up @@ -45,5 +44,4 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

return self;
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Custom-Cells/VeDetailFullAttachmentCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeDetailFullAttachmentCell.h"

@implementation VeDetailFullAttachmentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

Expand All @@ -28,5 +27,4 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

return self;
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Custom-Cells/VeNotificationCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeNotificationCell.h"

@implementation VeNotificationCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

Expand Down Expand Up @@ -94,5 +93,4 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

return self;
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Custom-Cells/VeSearchBarCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeSearchBarCell.h"

@implementation VeSearchBarCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

Expand All @@ -28,5 +27,4 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

return self;
}

@end
2 changes: 0 additions & 2 deletions Tweak/Settings/Custom-Cells/VeStatisticsCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "VeStatisticsCell.h"

@implementation VeStatisticsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier specifier:specifier];

Expand Down Expand Up @@ -171,5 +170,4 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

return self;
}

@end
21 changes: 15 additions & 6 deletions Tweak/SpringBoard/VeSpringBoard.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,40 @@
- (void)publishBulletin:(id)arg1 destinations:(unsigned long long)arg2 {
%orig;

BOOL isLoggingTemporarilyDisabled = [[preferences valueForKey:@"isLoggingTemporarilyDisabled"] boolValue];
if (isLoggingTemporarilyDisabled) return;
if ([preferences objectForKey:@"isLoggingTemporarilyDisabled"]) {
if ([[preferences valueForKey:@"isLoggingTemporarilyDisabled"] boolValue]) {
return;
}
}

BBBulletin* bulletin = arg1;
HBPreferences* logs = [[HBPreferences alloc] initWithIdentifier:@"dev.traurige.ve-logs"];

// prevent duplicates
if ([[[logs objectForKey:@"loggedNotifications"] valueForKey:@"date"] containsObject:[bulletin date]]) {
if ([[[logs objectForKey:@"loggedNotifications"] valueForKey:@"date"] containsObject:[bulletin date]]) {
return;
}

// return if the notification comes from a blocked bundle identifier or contains an excluded phrase
NSArray* blockedBundleIdentifiers = [logs objectForKey:@"blockedBundleIdentifiers"];
NSArray* excludedPhrases = [logs objectForKey:@"excludedPhrases"];
if ([blockedBundleIdentifiers count] > 0 || [excludedPhrases count] > 0) {
if ([blockedBundleIdentifiers containsObject:[arg1 sectionID]]) return;
if ([blockedBundleIdentifiers containsObject:[arg1 sectionID]]) {
return;
}

for (NSString* phrase in excludedPhrases) {
if ([[bulletin title] localizedCaseInsensitiveContainsString:phrase] || [[bulletin message] localizedCaseInsensitiveContainsString:phrase]) return;
if ([[bulletin title] localizedCaseInsensitiveContainsString:phrase] || [[bulletin message] localizedCaseInsensitiveContainsString:phrase]) {
return;
}
}
}

// save the incoming notification and its details
if ([bulletin sectionID]) {
if (!logMessagesWithoutContentSwitch && (![bulletin message] || [[bulletin message] isEqualToString:@""])) return;
if (!logMessagesWithoutContentSwitch && (![bulletin message] || [[bulletin message] isEqualToString:@""])) {
return;
}

NSMutableArray* attachments;
// save all attachments
Expand Down

0 comments on commit 4e6e5b4

Please sign in to comment.