Started working on new conversation / address validation
This commit is contained in:
@@ -1898,3 +1898,29 @@ typedef void (^CDUnknownBlockType)(void); // return type and parameters are unkn
|
|||||||
- (void)differencesFromArray:(id)arg1 removedIndexes:(id *)arg2 insertedIndexes:(id *)arg3;
|
- (void)differencesFromArray:(id)arg1 removedIndexes:(id *)arg2 insertedIndexes:(id *)arg3;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
extern BOOL IMStringIsEmail (NSString *string);
|
||||||
|
|
||||||
|
extern NSString* IMStripFormattingFromAddress (NSString *address);
|
||||||
|
|
||||||
|
typedef void(^IMChatCalculateServiceForSendingCompletionBlock) (BOOL allAddressesiMessageCapable,
|
||||||
|
NSDictionary *availabilityPerRecipient,
|
||||||
|
BOOL checkedServer,
|
||||||
|
NSError *error);
|
||||||
|
|
||||||
|
extern void IMChatCalculateServiceForSendingNewComposeMaybeForce (NSArray *addresses,
|
||||||
|
NSString *senderLastAddressedHandle,
|
||||||
|
NSString *senderLastAddressedSIMID,
|
||||||
|
BOOL forceMMS,
|
||||||
|
BOOL hasEmailRecipients,
|
||||||
|
BOOL lastSentMessageWasNotDelivered,
|
||||||
|
BOOL conversationWasDowngraded,
|
||||||
|
BOOL hasConversationHistory,
|
||||||
|
IMService *previousService,
|
||||||
|
IMChatCalculateServiceForSendingCompletionBlock completion);
|
||||||
|
|
||||||
|
|
||||||
|
// IDS
|
||||||
|
|
||||||
|
extern NSString *IDSCopyIDForPhoneNumber(NSString *phoneNumber);
|
||||||
|
extern NSString *IDSCopyIDForEmailAddress(NSString *emailAddress);
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,8 @@
|
|||||||
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */; };
|
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CD602061219B68950024D9C5 /* MBIMSendMessageOperation.m */; };
|
||||||
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E155219BE10A00F4CCEA /* hooking.m */; };
|
CD83E156219BE10A00F4CCEA /* hooking.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E155219BE10A00F4CCEA /* hooking.m */; };
|
||||||
CD83E166219BE91600F4CCEA /* agentHook.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E165219BE91600F4CCEA /* agentHook.m */; };
|
CD83E166219BE91600F4CCEA /* agentHook.m in Sources */ = {isa = PBXBuildFile; fileRef = CD83E165219BE91600F4CCEA /* agentHook.m */; };
|
||||||
|
CDD8C98426977D2A00551AE5 /* MBIMAliasValidationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDD8C98326977D2A00551AE5 /* MBIMAliasValidationOperation.m */; };
|
||||||
|
CDD8C9862697996800551AE5 /* IDS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDD8C9852697996700551AE5 /* IDS.framework */; };
|
||||||
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */; };
|
CDE4556421A3578A0041F5DD /* IMChat+Encoded.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */; };
|
||||||
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
|
CDE455A121A365AD0041F5DD /* MBIMMarkOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A021A365AD0041F5DD /* MBIMMarkOperation.m */; };
|
||||||
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */; };
|
CDE455A421A5308D0041F5DD /* MBIMFetchAttachmentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = CDE455A321A5308D0041F5DD /* MBIMFetchAttachmentOperation.m */; };
|
||||||
@@ -236,6 +238,9 @@
|
|||||||
CD83E161219BE91500F4CCEA /* libagentHook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libagentHook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
CD83E161219BE91500F4CCEA /* libagentHook.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libagentHook.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
CD83E165219BE91600F4CCEA /* agentHook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = agentHook.m; sourceTree = "<group>"; };
|
CD83E165219BE91600F4CCEA /* agentHook.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = agentHook.m; sourceTree = "<group>"; };
|
||||||
CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = hookAgent.sh; sourceTree = "<group>"; };
|
CD83E1B5219BF78E00F4CCEA /* hookAgent.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = hookAgent.sh; sourceTree = "<group>"; };
|
||||||
|
CDD8C98226977D2A00551AE5 /* MBIMAliasValidationOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMAliasValidationOperation.h; sourceTree = "<group>"; };
|
||||||
|
CDD8C98326977D2A00551AE5 /* MBIMAliasValidationOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBIMAliasValidationOperation.m; sourceTree = "<group>"; };
|
||||||
|
CDD8C9852697996700551AE5 /* IDS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDS.framework; path = System/Library/PrivateFrameworks/IDS.framework; sourceTree = SDKROOT; };
|
||||||
CDE4556221A3578A0041F5DD /* IMChat+Encoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IMChat+Encoded.h"; sourceTree = "<group>"; };
|
CDE4556221A3578A0041F5DD /* IMChat+Encoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IMChat+Encoded.h"; sourceTree = "<group>"; };
|
||||||
CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "IMChat+Encoded.m"; sourceTree = "<group>"; };
|
CDE4556321A3578A0041F5DD /* IMChat+Encoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "IMChat+Encoded.m"; sourceTree = "<group>"; };
|
||||||
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMarkOperation.h; sourceTree = "<group>"; };
|
CDE4559F21A365AD0041F5DD /* MBIMMarkOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBIMMarkOperation.h; sourceTree = "<group>"; };
|
||||||
@@ -274,6 +279,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
CDD8C9862697996800551AE5 /* IDS.framework in Frameworks */,
|
||||||
1A257CCB23A8681200A4A2C8 /* Security.framework in Frameworks */,
|
1A257CCB23A8681200A4A2C8 /* Security.framework in Frameworks */,
|
||||||
1ACFCFDF219EB31400E2C237 /* CocoaHTTPServer.framework in Frameworks */,
|
1ACFCFDF219EB31400E2C237 /* CocoaHTTPServer.framework in Frameworks */,
|
||||||
1A257CC923A867EF00A4A2C8 /* IMCore.framework in Frameworks */,
|
1A257CC923A867EF00A4A2C8 /* IMCore.framework in Frameworks */,
|
||||||
@@ -321,6 +327,7 @@
|
|||||||
1A0C445E219A45B400F2AC00 /* Frameworks */ = {
|
1A0C445E219A45B400F2AC00 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
CDD8C9852697996700551AE5 /* IDS.framework */,
|
||||||
1A257CCA23A8681200A4A2C8 /* Security.framework */,
|
1A257CCA23A8681200A4A2C8 /* Security.framework */,
|
||||||
1A257CC823A867EF00A4A2C8 /* IMCore.framework */,
|
1A257CC823A867EF00A4A2C8 /* IMCore.framework */,
|
||||||
);
|
);
|
||||||
@@ -522,6 +529,10 @@
|
|||||||
1AA43E90219EBB3400EDF1A7 /* Utilities */,
|
1AA43E90219EBB3400EDF1A7 /* Utilities */,
|
||||||
CD602054219B5DFD0024D9C5 /* MBIMBridgeOperation.h */,
|
CD602054219B5DFD0024D9C5 /* MBIMBridgeOperation.h */,
|
||||||
CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */,
|
CD602055219B5DFD0024D9C5 /* MBIMBridgeOperation.m */,
|
||||||
|
CDD8C98226977D2A00551AE5 /* MBIMAliasValidationOperation.h */,
|
||||||
|
CDD8C98326977D2A00551AE5 /* MBIMAliasValidationOperation.m */,
|
||||||
|
CD2ECEC0269539100055E302 /* MBIMAuthenticateOperation.h */,
|
||||||
|
CD2ECEC1269539100055E302 /* MBIMAuthenticateOperation.m */,
|
||||||
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */,
|
CD60205A219B623F0024D9C5 /* MBIMMessagesListOperation.h */,
|
||||||
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
|
CD60205B219B623F0024D9C5 /* MBIMMessagesListOperation.m */,
|
||||||
CD60205D219B674B0024D9C5 /* MBIMConversationListOperation.h */,
|
CD60205D219B674B0024D9C5 /* MBIMConversationListOperation.h */,
|
||||||
@@ -536,8 +547,6 @@
|
|||||||
CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */,
|
CD14F1A0219FE7D600E7DD22 /* MBIMUpdatePollOperation.m */,
|
||||||
1AD8936C21EFD986009B599A /* MBIMUploadAttachmentOperation.h */,
|
1AD8936C21EFD986009B599A /* MBIMUploadAttachmentOperation.h */,
|
||||||
1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */,
|
1AD8936D21EFD986009B599A /* MBIMUploadAttachmentOperation.m */,
|
||||||
CD2ECEC0269539100055E302 /* MBIMAuthenticateOperation.h */,
|
|
||||||
CD2ECEC1269539100055E302 /* MBIMAuthenticateOperation.m */,
|
|
||||||
);
|
);
|
||||||
path = Operations;
|
path = Operations;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -840,6 +849,7 @@
|
|||||||
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */,
|
CDF6233A219A8A5600690038 /* MBIMBridge.m in Sources */,
|
||||||
CDF62335219A895D00690038 /* main.m in Sources */,
|
CDF62335219A895D00690038 /* main.m in Sources */,
|
||||||
CD60205C219B623F0024D9C5 /* MBIMMessagesListOperation.m in Sources */,
|
CD60205C219B623F0024D9C5 /* MBIMMessagesListOperation.m in Sources */,
|
||||||
|
CDD8C98426977D2A00551AE5 /* MBIMAliasValidationOperation.m in Sources */,
|
||||||
CD14F1AA219FF3B800E7DD22 /* MBIMUpdateQueue.m in Sources */,
|
CD14F1AA219FF3B800E7DD22 /* MBIMUpdateQueue.m in Sources */,
|
||||||
CD14F1A4219FF22700E7DD22 /* IMMessageItem+Encoded.m in Sources */,
|
CD14F1A4219FF22700E7DD22 /* IMMessageItem+Encoded.m in Sources */,
|
||||||
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */,
|
CD602062219B68950024D9C5 /* MBIMSendMessageOperation.m in Sources */,
|
||||||
|
|||||||
17
kordophone/Bridge/Operations/MBIMAliasValidationOperation.h
Normal file
17
kordophone/Bridge/Operations/MBIMAliasValidationOperation.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// MBIMAliasValidationOperation.h
|
||||||
|
// MBIMAliasValidationOperation
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 7/8/21.
|
||||||
|
// Copyright © 2021 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMBridgeOperation.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface MBIMAliasValidationOperation : MBIMBridgeOperation
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
58
kordophone/Bridge/Operations/MBIMAliasValidationOperation.m
Normal file
58
kordophone/Bridge/Operations/MBIMAliasValidationOperation.m
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
//
|
||||||
|
// MBIMAliasValidationOperation.m
|
||||||
|
// MBIMAliasValidationOperation
|
||||||
|
//
|
||||||
|
// Created by James Magahern on 7/8/21.
|
||||||
|
// Copyright © 2021 James Magahern. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "MBIMAliasValidationOperation.h"
|
||||||
|
|
||||||
|
#import "IMCore_ClassDump.h"
|
||||||
|
#import "IMFoundation_ClassDump.h"
|
||||||
|
|
||||||
|
@implementation MBIMAliasValidationOperation
|
||||||
|
|
||||||
|
+ (void)load { [super load]; }
|
||||||
|
|
||||||
|
+ (NSString *)endpointName
|
||||||
|
{
|
||||||
|
return @"validate";
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)main
|
||||||
|
{
|
||||||
|
NSString *address = [self valueForQueryItemWithName:@"address"];
|
||||||
|
if ([address length] == 0) {
|
||||||
|
self.serverCompletionBlock([[HTTPErrorResponse alloc] initWithErrorCode:401]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *unformattedAddress = IMStripFormattingFromAddress(address);
|
||||||
|
IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]];
|
||||||
|
IMHandle *handle = [iMessageAccount imHandleWithID:unformattedAddress];
|
||||||
|
|
||||||
|
BOOL isEmailAddress = IMStringIsEmail(unformattedAddress);
|
||||||
|
|
||||||
|
NSString *IDSaddress = isEmailAddress ? IDSCopyIDForEmailAddress(unformattedAddress)
|
||||||
|
: IDSCopyIDForPhoneNumber(unformattedAddress);
|
||||||
|
|
||||||
|
if (!IDSaddress) {
|
||||||
|
MBIMLogError(@"Could not get IDS address for: %@", unformattedAddress);
|
||||||
|
self.serverCompletionBlock([[HTTPErrorResponse alloc] initWithErrorCode:401]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMChatCalculateServiceForSendingNewComposeMaybeForce(
|
||||||
|
@[ IDSaddress ], nil, nil, NO, isEmailAddress, NO, NO, NO, nil,
|
||||||
|
^(BOOL allAddressesiMessageCapable, NSDictionary *availabilityPerRecipient, BOOL checkedServer, NSError *error) {
|
||||||
|
NSLog(@"Capable: %d", allAddressesiMessageCapable);
|
||||||
|
NSLog(@"Avail: %@", availabilityPerRecipient);
|
||||||
|
self.serverCompletionBlock([MBIMJSONDataResponse responseWithJSONObject:@{
|
||||||
|
@"capable" : @(allAddressesiMessageCapable),
|
||||||
|
}]);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
Reference in New Issue
Block a user