Skip to content

Commit

Permalink
Fix crash if IMMessageItem somehow doesn't have typing indicator sele…
Browse files Browse the repository at this point in the history
…ctors on it
  • Loading branch information
tneotia committed Mar 16, 2023
1 parent ec9a275 commit a4de823
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions MacOS-11+/BlueBubblesHelper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEPLOYMENT_LOCATION = YES;
DEVELOPMENT_TEAM = S6D73TBQQU;
DSTROOT = /;
Expand All @@ -675,7 +675,7 @@
INSTALL_PATH = "/Library/Application Support/MacEnhance/Plugins";
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.0.13;
MARKETING_VERSION = 0.0.14;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.bluebubbles.messaging;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -696,7 +696,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEPLOYMENT_LOCATION = YES;
DEVELOPMENT_TEAM = S6D73TBQQU;
DSTROOT = /;
Expand All @@ -711,7 +711,7 @@
INSTALL_PATH = "/Library/Application Support/MacEnhance/Plugins";
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.0.13;
MARKETING_VERSION = 0.0.14;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.bluebubbles.messaging;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -953,14 +953,14 @@ - (BOOL)_handleIncomingItem:(id)arg1 {
BOOL hasBeenHandled = ZKOrig(BOOL, arg1);
NSString *guid = (NSString *)ZKHookIvar(self, NSString*, "_guid");
if (guid != nil) {
// check if incoming item is a typing indicator or not, and update the status accordingly
if ([item isIncomingTypingMessage]) {
// check if incoming item is a typing indicator or not, and update the status accordingly. check if the class responds to the selector to avoid crashes
if ([item respondsToSelector:@selector(isIncomingTypingMessage)] && [item isIncomingTypingMessage]) {
[[NetworkController sharedInstance] sendMessage: @{@"event": @"started-typing", @"guid": guid}];
DLog("BLUEBUBBLESHELPER: %{public}@ started typing", guid);
} else if ([item isCancelTypingMessage]) {
} else if ([item respondsToSelector:@selector(isCancelTypingMessage)] && [item isCancelTypingMessage]) {
[[NetworkController sharedInstance] sendMessage: @{@"event": @"stopped-typing", @"guid": guid}];
DLog("BLUEBUBBLESHELPER: %{public}@ stopped typing", guid);
} else if ([[item message] isTypingMessage] == NO) {
} else if ([item respondsToSelector:@selector(isTypingMessage)] && [[item message] isTypingMessage] == NO) {
[[NetworkController sharedInstance] sendMessage: @{@"event": @"stopped-typing", @"guid": guid}];
DLog("BLUEBUBBLESHELPER: %{public}@ stopped typing", guid);
}
Expand Down

0 comments on commit a4de823

Please sign in to comment.