Skip to content

Commit

Permalink
Remove dup
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsylerpowers authored Feb 16, 2023
1 parent fca68fd commit e6454df
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions MacOS-10/BlueBubblesHelper/BlueBubblesHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,8 @@ +(void) sendMessage: (NSDictionary *) data transfers: (NSArray *) transfers attr
}

NSMutableAttributedString *subjectAttributedString = nil;
BOOL subject = false;
if (data[@"subject"] != [NSNull null] && [data[@"subject"] length] != 0) {
subjectAttributedString = [[NSMutableAttributedString alloc] initWithString: data[@"subject"]];
subject = true;
}
NSString *effectId = nil;
if (data[@"effectId"] != [NSNull null] && [data[@"effectId"] length] != 0) {
Expand All @@ -765,7 +763,7 @@ +(void) sendMessage: (NSDictionary *) data transfers: (NSArray *) transfers attr
isAudioMessage = [data[@"isAudioMessage"] integerValue] == 1;
}

void (^createMessage)(NSAttributedString*, NSAttributedString*, NSString*, NSString*, NSArray*, BOOL, BOOL) = ^(NSAttributedString *message, NSAttributedString *subject, NSString *effectId, NSString *threadIdentifier, NSArray *transferGUIDs, BOOL isAudioMessage, BOOL subject) {
void (^createMessage)(NSAttributedString*, NSAttributedString*, NSString*, NSString*, NSArray*, BOOL, BOOL) = ^(NSAttributedString *message, NSAttributedString *subject, NSString *effectId, NSString *threadIdentifier, NSArray *transferGUIDs, BOOL isAudioMessage) {
IMMessage *messageToSend = [[IMMessage alloc] init];
messageToSend = [messageToSend initWithSender:(nil) time:(nil) text:(message) messageSubject:(subject) fileTransferGUIDs:(transferGUIDs) flags:(isAudioMessage ? 0x300005 : (subject ? 0x10000d : 0x100005)) error:(nil) guid:(nil) subject:(nil) balloonBundleID:(nil) payloadData:(nil) expressiveSendStyleID:(effectId)];
[chat sendMessage:(messageToSend)];
Expand All @@ -774,7 +772,7 @@ +(void) sendMessage: (NSDictionary *) data transfers: (NSArray *) transfers attr
}
};

createMessage(attributedString, subjectAttributedString, effectId, nil, transfers, isAudioMessage, subject);
createMessage(attributedString, subjectAttributedString, effectId, nil, transfers, isAudioMessage);
}

@end
Expand Down

0 comments on commit e6454df

Please sign in to comment.