From 7a3dee70735ea566dfa7cdc915948cc55b949a2c Mon Sep 17 00:00:00 2001 From: James Magahern Date: Mon, 12 Nov 2018 22:15:50 -0800 Subject: [PATCH] Bit of cleanup --- kordophone/Bridge/MBIMBridge.m | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/kordophone/Bridge/MBIMBridge.m b/kordophone/Bridge/MBIMBridge.m index 75d5d28..54621a3 100644 --- a/kordophone/Bridge/MBIMBridge.m +++ b/kordophone/Bridge/MBIMBridge.m @@ -16,7 +16,7 @@ #import #import -static NSString *const MBIMBridgeToken = @"net.buzzert.MBIMBridge"; +static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone"; static NSString *const kAPIEndpointConversationList = @"conversations"; static NSString *const kAPIEndpointConversationContents = @"messages"; @@ -93,19 +93,9 @@ static NSString *const kAPIEndpointSendMessage = @"sendMessage"; - (void)_messageReceived:(NSNotification *)notification { - NSLog(@"Received!"); + NSLog(@"Received message from chat with GUID: %@", [[notification object] guid]); - // Sending a message - /* - IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]]; - IMHandle *handle = [[iMessageAccount arrayOfAllIMHandles] firstObject]; - - NSAttributedString *replyAttrString = [[NSAttributedString alloc] initWithString:@"This is a test automated reply. Please ignore."]; - IMMessage *reply = [IMMessage fromMeIMHandle:handle withText:replyAttrString fileTransferGUIDs:@[] flags:kIMMessageFinished]; - - IMChat *chat = [notification object]; - [chat sendMessage:reply]; - */ + // TODO: Notify observers or something } - (void)_chatRegistryDidLoad:(NSNotification *)notification @@ -243,29 +233,30 @@ static NSString *const kAPIEndpointSendMessage = @"sendMessage"; - (void)daemonControllerWillConnect { - NSLog(@"About to connect to daemon"); + NSLog(@"Connecting to imagent..."); } - (void)daemonControllerDidConnect { - NSLog(@"Did connect to daemon"); + NSLog(@"imagent responded."); IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]]; if (iMessageAccount) { + NSLog(@"Successfully got accounts from imagent"); NSLog(@"iMessage account connected: %@", iMessageAccount); } else { - NSLog(@"Was not able to connect to iMessage account"); + NSLog(@"imagent returned no accounts (not entitled?)"); } } - (void)daemonControllerDidDisconnect { - NSLog(@"Did disconnect from daemon"); + NSLog(@"Disconnected from imagent"); } - (void)daemonConnectionLost { - NSLog(@"Connection lost to daemon"); + NSLog(@"Connection lost to imagent"); } @end