diff options
author | Vitaly Takmazov | 2016-08-28 21:03:22 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-08-28 21:03:22 +0300 |
commit | 188d8e4ea870d1a6c8edd5a9b323742804badeba (patch) | |
tree | 071067f7189a6474d49abb952b1b04b820985b7a /Juick/Message.m | |
parent | a74588083c4950e9237dff7a84ccdd129b72c950 (diff) |
project cleanup
Diffstat (limited to 'Juick/Message.m')
-rw-r--r-- | Juick/Message.m | 52 |
1 files changed, 0 insertions, 52 deletions
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 |