summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/DialogsViewController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-08 12:15:17 +0300
committerGravatar Vitaly Takmazov2018-04-08 12:15:17 +0300
commit2a4770c84aaf2be9c58622f108007facef670fd3 (patch)
treec8178619c2484618a5aec100394fc47e82075757 /Juick/ViewControllers/DialogsViewController.m
parent80239775563a1b29136ee64c29c2379a95e504c2 (diff)
PM pushes
Diffstat (limited to 'Juick/ViewControllers/DialogsViewController.m')
-rw-r--r--Juick/ViewControllers/DialogsViewController.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/Juick/ViewControllers/DialogsViewController.m b/Juick/ViewControllers/DialogsViewController.m
index d40dd95..5369a65 100644
--- a/Juick/ViewControllers/DialogsViewController.m
+++ b/Juick/ViewControllers/DialogsViewController.m
@@ -11,13 +11,16 @@
#import "ColorScheme.h"
#import "ConversationCell.h"
#import "APIClient.h"
+#import "AppDelegate.h"
@interface DialogsViewController ()
+
+@property(nonatomic, strong) AppDelegate *appDelegate;
+
@end
@implementation DialogsViewController
-
- (void)viewDidLoad {
[super viewDidLoad];
[self.tabBarItem setTitle:@"Chats"];
@@ -37,6 +40,7 @@
[self.tableView endUpdates];
}
}];
+ self.appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate;
}
#pragma mark - Table view data source
@@ -61,9 +65,17 @@
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"chatSegue"]) {
- Chat *chat = [self.chats objectAtIndex:[self.tableView indexPathForSelectedRow].row];
+ NSString *uname;
+ if ([self.appDelegate.pushedUname length] > 0) {
+ uname = [self.appDelegate.pushedUname copy];
+ self.appDelegate.pushedThread = nil;
+ self.appDelegate.pushedUname = nil;
+ } else {
+ Chat *chat = [self.chats objectAtIndex:[self.tableView indexPathForSelectedRow].row];
+ uname = chat.uname;
+ }
ChatViewController *vc = (ChatViewController *)segue.destinationViewController;
- [vc setUname:chat.uname];
+ [vc setUname:uname];
}
}