summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/DiscussionsController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-03-21 23:39:03 +0300
committerGravatar Vitaly Takmazov2019-03-21 23:39:03 +0300
commit6e49fc5c4273e7597925c133c3a6985b6ad85ecc (patch)
treeca5c8bac8e6bbe73d28db597be38840a4e88deca /Juick/ViewControllers/DiscussionsController.m
parent31cee12a4f5c2733965e99e2fa9add28fee266c2 (diff)
First RC
Diffstat (limited to 'Juick/ViewControllers/DiscussionsController.m')
-rw-r--r--Juick/ViewControllers/DiscussionsController.m35
1 files changed, 35 insertions, 0 deletions
diff --git a/Juick/ViewControllers/DiscussionsController.m b/Juick/ViewControllers/DiscussionsController.m
new file mode 100644
index 0000000..b8abd3d
--- /dev/null
+++ b/Juick/ViewControllers/DiscussionsController.m
@@ -0,0 +1,35 @@
+//
+// DiscussionsController.m
+// Juick
+//
+// Created by Vitaly Takmazov on 21/03/2019.
+// Copyright © 2019 com.juick. All rights reserved.
+//
+
+#import "DiscussionsController.h"
+#import "APIClient.h"
+
+@interface DiscussionsController ()
+
+@end
+
+@implementation DiscussionsController
+
+- (void)viewDidLoad {
+ self.messagesDelegate = self;
+ self.title = @"Discussions";
+ self.path = [APIClient discussionsUrl];
+ [self setShouldScrollToBottomOnRefresh:NO];
+ [super viewDidLoad];
+}
+
+- (void)loadMore {
+ Message *lastMsg = [self.messages lastObject];
+ if (lastMsg != nil) {
+ NSDate *msgDate = [[APIClient sharedClient].dateFormatter dateFromString:lastMsg.timestamp];
+ self.params = [@{@"to" : [NSString stringWithFormat:@"%.0f", [msgDate timeIntervalSince1970] * 1000]} mutableCopy];
+ [self setShouldScrollToBottomOnRefresh:NO];
+ }
+}
+
+@end