Skip to content

Fix scanMessage Implementation #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Messages/MacOS-11+/BlueBubblesHelper/BlueBubblesHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,17 @@ +(void) sendMessage: (NSDictionary *) data transfers: (NSArray *) transfers attr
messageToSend = [messageToSend initWithSender:(nil) time:(nil) text:(message) messageSubject:(subject) fileTransferGUIDs:(nil) flags:(0x5) error:(nil) guid:(nil) subject:(nil) associatedMessageGUID:(associatedMessageGuid) associatedMessageType:*(reaction) associatedMessageRange:(range) messageSummaryInfo:(summaryInfo)];
}
if (ddScan) {
[[IMDDController sharedInstance] scanMessage:messageToSend outgoing:TRUE waitUntilDone:TRUE completionBlock:^(NSObject* temp, NSObject* ddMessageToSend) {
[chat sendMessage:(ddMessageToSend)];
if (transaction != nil) {
[[NetworkController sharedInstance] sendMessage: @{@"transactionId": transaction, @"identifier": [[chat lastSentMessage] guid]}];
}
}];
__strong typeof(messageToSend) strongMessage = messageToSend;
__strong typeof(chat) strongChat = chat;

[[IMDDController sharedInstance] scanMessage:strongMessage outgoing:TRUE waitUntilDone:TRUE completionBlock:^(NSInteger status, BOOL success, id result) {
dispatch_async(dispatch_get_main_queue(), ^{
[strongChat sendMessage:(strongMessage)];
if (transaction != nil) {
[[NetworkController sharedInstance]sendMessage:@{@"transactionId": transaction, @"identifier": [[strongChat lastSentMessage] guid]}];
}
});
}];
} else {
[chat sendMessage:(messageToSend)];
if (transaction != nil) {
Expand Down
2 changes: 1 addition & 1 deletion Messages/MacOS-11+/BlueBubblesHelper/IMDDController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@interface IMDDController : NSObject

@property (retain, nonatomic) NSObject<OS_dispatch_queue> *scannerQueue; // ivar: _scannerQueue

@property (nonatomic, readonly) dispatch_queue_t queue;

+(id)sharedInstance;
-(BOOL)_scanAttributedStringWithMessage:(id)arg0 attributedString:(id)arg1 plainText:(id)arg2 ;
Expand Down