Private
Public Access
1
0
Files
Kordophone/kordophone/Bridge/Operations/MBIMConversationListOperation.m
James Magahern 4f7a6d1b87 Move off of macosxinternal sdk
This moves kordophone off of using the internal SDK and switches to using class dumped headers instead.
2019-12-16 17:29:53 -08:00

41 lines
998 B
Objective-C

//
// MBIMConversationListOperation.m
// kordophoned
//
// Created by James Magahern on 11/13/18.
// Copyright © 2018 James Magahern. All rights reserved.
//
#import "MBIMConversationListOperation.h"
#import "MBIMHTTPUtilities.h"
#import "IMChat+Encoded.h"
#import "IMCore_ClassDump.h"
@implementation MBIMConversationListOperation
+ (void)load { [super load]; }
+ (NSString *)endpointName
{
return @"conversations";
}
- (void)main
{
__block NSMutableArray *conversations = [NSMutableArray array];
dispatch_sync([[self class] sharedIMAccessQueue], ^{
NSArray<IMChat *> *chats = [[IMChatRegistry sharedInstance] allExistingChats];
for (IMChat *chat in chats) {
NSDictionary *chatDict = [chat mbim_dictionaryRepresentation];
[conversations addObject:chatDict];
}
});
MBIMJSONDataResponse *response = [MBIMJSONDataResponse responseWithJSONObject:conversations];
self.serverCompletionBlock(response);
}
@end