summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/MessagesViewController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-10-31 16:16:48 +0300
committerGravatar Vitaly Takmazov2020-05-12 16:38:25 +0300
commit9d78e7d654c51c22ce4be87efef5bc1f8d5a2d08 (patch)
treedfb028dfca07fdb7bbacc00771f9e865f28fd6d4 /Juick/ViewControllers/MessagesViewController.m
parent742e1a0e615a7e07a9f4b4c249227cd63839325f (diff)
Fix authentication
Diffstat (limited to 'Juick/ViewControllers/MessagesViewController.m')
-rw-r--r--Juick/ViewControllers/MessagesViewController.m8
1 files changed, 3 insertions, 5 deletions
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index 25a2ca5..f61d8b4 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -9,8 +9,6 @@
#import "MessagesViewController.h"
#import "MessageCell.h"
-#import "AppDelegate.h"
-#import "APIClient.h"
#import "Message.h"
#import "NewPostViewController.h"
@@ -35,20 +33,20 @@ NSString* const messageCellIdentifier = @"messageCell";
if (self.messages.count == 0) {
[self.tableView reloadData];
}
- [[APIClient sharedClient] pullNextFromPath:self.path params:self.params callback:^(NSArray *next, NSError *err) {
+ [[AppDelegate shared].api pullNextFromPath:self.path params:self.params callback:^(NSArray *next, NSError *err) {
if (err) {
[User throwUnableToLogin:self error:err];
return;
}
NSArray *newMsgs = next;
if ([self isAtTop:self.params]) {
- if (![self.path isEqualToString:[APIClient threadUrl]]) {
+ if (![self.path isEqualToString:[API threadUrl]]) {
[self.messages removeAllObjects];
[self.tableView reloadData];
}
}
NSUInteger oldCount = [self.messages count];
- if ([self.path isEqualToString:[APIClient threadUrl]]) {
+ if ([self.path isEqualToString:[API threadUrl]]) {
NSUInteger lastRid = [((Message *)[self.messages lastObject]).rid unsignedIntegerValue] + 1;
NSUInteger count = [next count];
if (oldCount > 0) {