summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/NewPostViewController.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/NewPostViewController.m
parent742e1a0e615a7e07a9f4b4c249227cd63839325f (diff)
Fix authentication
Diffstat (limited to 'Juick/ViewControllers/NewPostViewController.m')
-rw-r--r--Juick/ViewControllers/NewPostViewController.m8
1 files changed, 3 insertions, 5 deletions
diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m
index e4b5ac7..344e7b9 100644
--- a/Juick/ViewControllers/NewPostViewController.m
+++ b/Juick/ViewControllers/NewPostViewController.m
@@ -9,8 +9,6 @@
#import "NewPostViewController.h"
#import "MessagesViewController.h"
#import "QuoteView.h"
-#import "APIClient.h"
-#import "AppDelegate.h"
NSString * const NewMessageNotificationName = @"NewMessage";
NSString * const ReplyPostedNotificationName = @"ReplyPosted";
@@ -47,8 +45,8 @@ NSString * const ReplyPostedNotificationName = @"ReplyPosted";
- (IBAction)sendAction:(id)sender {
self.navigationItem.rightBarButtonItem.enabled = NO;
if (_replyTo == nil) {
- self.navigationItem.rightBarButtonItem.enabled = YES;
- [[APIClient sharedClient] postMessage:self.textView.text result:^(Message *msg, NSError *err) {
+ [[AppDelegate shared].api postMessage:self.textView.text result:^(Message *msg, NSError *err) {
+ self.navigationItem.rightBarButtonItem.enabled = YES;
if (!err) {
[self dismissViewControllerAnimated:YES completion:^{
[[NSNotificationCenter defaultCenter] postNotificationName:NewMessageNotificationName object:msg];
@@ -60,7 +58,7 @@ NSString * const ReplyPostedNotificationName = @"ReplyPosted";
}];
} else {
self.navigationItem.rightBarButtonItem.enabled = NO;
- [[APIClient sharedClient] postReplyToThread:_replyTo.mid inReplyTo:_replyTo.rid text:self.textView.text result:^(Message *msg, NSError *err) {
+ [[AppDelegate shared].api postReplyToThread:_replyTo.mid inReplyTo:_replyTo.rid text:self.textView.text result:^(Message *msg, NSError *err) {
if (!err) {
[self dismissViewControllerAnimated:YES completion:^{
[[NSNotificationCenter defaultCenter] postNotificationName:ReplyPostedNotificationName object:msg];