Private
Public Access
1
0

Move off of macosxinternal sdk

This moves kordophone off of using the internal SDK and switches to using class dumped headers instead.
This commit is contained in:
James Magahern
2019-12-16 17:29:53 -08:00
parent 6c089f737b
commit 4f7a6d1b87
20 changed files with 8610 additions and 207 deletions

View File

@@ -16,11 +16,8 @@
#import <CocoaHTTPServer/HTTPServer.h>
#import <IMCore/IMCore.h>
#import <IMCore/IMCore_Private.h>
#import <IMFoundation/IMFoundation.h>
#import <IMFoundation/IMFoundation_Private.h>
#import "IMCore_ClassDump.h"
#import "IMFoundation_ClassDump.h"
static const UInt16 kDefaultPort = 5738;
@@ -136,11 +133,11 @@ static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
[self registerForNotifications];
[sDaemonController setDelegate:self];
[sDaemonListener addHandler:self];
[[IMDaemonController sharedInstance] setDelegate:(id)self];
[[[IMDaemonController sharedInstance] listener] addHandler:self];
if (![sDaemonController hasListenerForID:MBIMBridgeToken]) {
if (![sDaemonController addListenerID:MBIMBridgeToken capabilities:(kFZListenerCapFileTransfers | kFZListenerCapManageStatus | kFZListenerCapChats | kFZListenerCapMessageHistory | kFZListenerCapIDQueries | kFZListenerCapSendMessages)]) {
if (![[IMDaemonController sharedInstance] hasListenerForID:MBIMBridgeToken]) {
if (![[IMDaemonController sharedInstance] addListenerID:MBIMBridgeToken capabilities:(kFZListenerCapFileTransfers | kFZListenerCapManageStatus | kFZListenerCapChats | kFZListenerCapMessageHistory | kFZListenerCapIDQueries | kFZListenerCapSendMessages)]) {
MBIMLogFatal(@"Failed to connect to imagent");
[self _terminate];
@@ -153,7 +150,7 @@ static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
- (void)disconnect
{
[sDaemonController removeListenerID:MBIMBridgeToken];
[[IMDaemonController sharedInstance] removeListenerID:MBIMBridgeToken];
}
#pragma mark -
@@ -196,7 +193,7 @@ static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
- (void)_chatRegistryDidLoad:(NSNotification *)notification
{
MBIMLogInfo(@"Loaded chat registry. %lu existing chats", (unsigned long)[sChatRegistry numberOfExistingChats]);
MBIMLogInfo(@"Loaded chat registry. %lu existing chats", (unsigned long)[[IMChatRegistry sharedInstance] numberOfExistingChats]);
}
- (void)_chatItemsDidChange:(NSNotification *)notification

View File

@@ -6,8 +6,8 @@
// Copyright © 2018 James Magahern. All rights reserved.
//
#import <IMCore/IMCore.h>
#import <IMFoundation/IMFoundation.h>
#import "IMCore_ClassDump.h"
#import "IMFoundation_ClassDump.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -10,7 +10,7 @@
#import "MBIMHTTPUtilities.h"
#import "IMChat+Encoded.h"
#import <IMCore/IMCore.h>
#import "IMCore_ClassDump.h"
@implementation MBIMConversationListOperation
@@ -26,7 +26,7 @@
__block NSMutableArray *conversations = [NSMutableArray array];
dispatch_sync([[self class] sharedIMAccessQueue], ^{
NSArray<IMChat *> *chats = [sChatRegistry allExistingChats];
NSArray<IMChat *> *chats = [[IMChatRegistry sharedInstance] allExistingChats];
for (IMChat *chat in chats) {
NSDictionary *chatDict = [chat mbim_dictionaryRepresentation];
[conversations addObject:chatDict];

View File

@@ -9,7 +9,7 @@
#import "MBIMFetchAttachmentOperation.h"
#import "MBIMDataResponse.h"
#import <IMCore/IMCore.h>
#import "IMCore_ClassDump.h"
@implementation MBIMFetchAttachmentOperation

View File

@@ -7,7 +7,7 @@
//
#import "MBIMMarkOperation.h"
#import <IMCore/IMCore.h>
#import "IMCore_ClassDump.h"
@implementation MBIMMarkOperation
@@ -31,7 +31,7 @@
}
dispatch_sync([[self class] sharedIMAccessQueue], ^{
IMChat *chat = [sChatRegistry existingChatWithGUID:guid];
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:guid];
if (!chat) {
MBIMLogInfo(@"Chat with guid: %@ not found", guid);
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];

View File

@@ -10,7 +10,7 @@
#import "MBIMHTTPUtilities.h"
#import "IMMessageItem+Encoded.h"
#import <IMCore/IMCore.h>
#import "IMCore_ClassDump.h"
@implementation MBIMMessagesListOperation
@@ -35,7 +35,7 @@
__block NSMutableArray *messages = [NSMutableArray array];
dispatch_sync([[self class] sharedIMAccessQueue], ^{
IMChat *chat = [sChatRegistry existingChatWithGUID:guid];
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:guid];
if (!chat) {
MBIMLogInfo(@"Chat with guid: %@ not found", guid);
response = [[HTTPErrorResponse alloc] initWithErrorCode:500];

View File

@@ -8,8 +8,7 @@
#import "MBIMSendMessageOperation.h"
#import <IMCore/IMCore.h>
#import <IMCore/IMCore_Private.h>
#import "IMCore_ClassDump.h"
@implementation MBIMSendMessageOperation
@@ -25,7 +24,7 @@
__block BOOL result = YES;
dispatch_sync([[self class] sharedIMAccessQueue], ^{
IMChat *chat = [sChatRegistry existingChatWithGUID:chatGUID];
IMChat *chat = [[IMChatRegistry sharedInstance] existingChatWithGUID:chatGUID];
// TODO: chat might not be an iMessage chat!
IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]];

View File

@@ -9,7 +9,7 @@
#import "MBIMUploadAttachmentOperation.h"
#import "MBIMDataResponse.h"
#import <IMCore/IMCore.h>
#import "IMCore_ClassDump.h"
@implementation MBIMUploadAttachmentOperation

View File

@@ -6,7 +6,7 @@
// Copyright © 2018 James Magahern. All rights reserved.
//
#import <IMCore/IMCore.h>
#import "IMCore_ClassDump.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -6,8 +6,7 @@
// Copyright © 2018 James Magahern. All rights reserved.
//
#import <IMCore/IMCore.h>
#import <IMSharedUtilities/IMSharedUtilities.h>
#import "IMCore_ClassDump.h"
NS_ASSUME_NONNULL_BEGIN