From 188d8e4ea870d1a6c8edd5a9b323742804badeba Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 28 Aug 2016 21:03:22 +0300 Subject: project cleanup --- Juick/Message.m | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 Juick/Message.m (limited to 'Juick/Message.m') diff --git a/Juick/Message.m b/Juick/Message.m deleted file mode 100644 index de08e98..0000000 --- a/Juick/Message.m +++ /dev/null @@ -1,52 +0,0 @@ -// -// Message.m -// Juick -// -// Created by Vitaly Takmazov on 29.10.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import "Message.h" -#import "PDKeychainBindings.h" - -@implementation Message - -+ (NSDictionary *)modelCustomPropertyMapper { - return @{@"text" : @"body", - @"MID" : @"mid", - @"RID" : @"rid", - @"attach" : @"photo.small", - @"repliesCount": @"replies", - @"repliesBy": @"repliesby"}; -} - - -+(void) pullNextFromPath:(NSString *)path params:(NSDictionary *) params callback:(void(^)(NSArray *))callback { - AFHTTPSessionManager *manager = [APIClient sharedClient].manager; - if ([[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] != nil) { - [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] password:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.password"]]; - } - [manager GET:path parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - NSMutableArray *messages = [NSMutableArray new]; - [((NSArray *)responseObject) enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [messages addObject:[Message yy_modelWithJSON:obj]]; - }]; - callback(messages); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { - NSLog(@"REST Error: %@", error); - }]; -} - -+(NSString *) messagesUrl { - return @"https://api.juick.com/messages"; -} - -+(NSString *) threadUrl { - return @"https://api.juick.com/thread"; -} - -+(NSString *) feedUrl { - return @"https://api.juick.com/home"; -} - -@end -- cgit v1.2.3