Bit of cleanup
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
#import <IMFoundation/IMFoundation.h>
|
#import <IMFoundation/IMFoundation.h>
|
||||||
#import <IMFoundation/IMFoundation_Private.h>
|
#import <IMFoundation/IMFoundation_Private.h>
|
||||||
|
|
||||||
static NSString *const MBIMBridgeToken = @"net.buzzert.MBIMBridge";
|
static NSString *const MBIMBridgeToken = @"net.buzzert.kordophone";
|
||||||
|
|
||||||
static NSString *const kAPIEndpointConversationList = @"conversations";
|
static NSString *const kAPIEndpointConversationList = @"conversations";
|
||||||
static NSString *const kAPIEndpointConversationContents = @"messages";
|
static NSString *const kAPIEndpointConversationContents = @"messages";
|
||||||
@@ -93,19 +93,9 @@ static NSString *const kAPIEndpointSendMessage = @"sendMessage";
|
|||||||
|
|
||||||
- (void)_messageReceived:(NSNotification *)notification
|
- (void)_messageReceived:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
NSLog(@"Received!");
|
NSLog(@"Received message from chat with GUID: %@", [[notification object] guid]);
|
||||||
|
|
||||||
// Sending a message
|
// TODO: Notify observers or something
|
||||||
/*
|
|
||||||
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];
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_chatRegistryDidLoad:(NSNotification *)notification
|
- (void)_chatRegistryDidLoad:(NSNotification *)notification
|
||||||
@@ -243,29 +233,30 @@ static NSString *const kAPIEndpointSendMessage = @"sendMessage";
|
|||||||
|
|
||||||
- (void)daemonControllerWillConnect
|
- (void)daemonControllerWillConnect
|
||||||
{
|
{
|
||||||
NSLog(@"About to connect to daemon");
|
NSLog(@"Connecting to imagent...");
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)daemonControllerDidConnect
|
- (void)daemonControllerDidConnect
|
||||||
{
|
{
|
||||||
NSLog(@"Did connect to daemon");
|
NSLog(@"imagent responded.");
|
||||||
|
|
||||||
IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]];
|
IMAccount *iMessageAccount = [[IMAccountController sharedInstance] bestAccountForService:[IMServiceImpl iMessageService]];
|
||||||
if (iMessageAccount) {
|
if (iMessageAccount) {
|
||||||
|
NSLog(@"Successfully got accounts from imagent");
|
||||||
NSLog(@"iMessage account connected: %@", iMessageAccount);
|
NSLog(@"iMessage account connected: %@", iMessageAccount);
|
||||||
} else {
|
} else {
|
||||||
NSLog(@"Was not able to connect to iMessage account");
|
NSLog(@"imagent returned no accounts (not entitled?)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)daemonControllerDidDisconnect
|
- (void)daemonControllerDidDisconnect
|
||||||
{
|
{
|
||||||
NSLog(@"Did disconnect from daemon");
|
NSLog(@"Disconnected from imagent");
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)daemonConnectionLost
|
- (void)daemonConnectionLost
|
||||||
{
|
{
|
||||||
NSLog(@"Connection lost to daemon");
|
NSLog(@"Connection lost to imagent");
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user