summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/MessagesViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers/MessagesViewController.m')
-rw-r--r--Juick/ViewControllers/MessagesViewController.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index afa0f9a..ad28484 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -106,6 +106,7 @@ NSString* const messageCellIdentifier = @"messageCell";
self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged];
[self refreshData];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newMessage:) name:NewMessageNotificationName object:nil];
}
- (void) composePressed {
@@ -174,4 +175,9 @@ NSString* const messageCellIdentifier = @"messageCell";
[self.navigationController pushViewController:threadVC animated:YES];
}
+-(void) newMessage:(NSNotification *)obj {
+ Message *msg = (Message *)[obj object];
+ [self viewThreadForMessage:msg mid:msg.mid scrollTo:0];
+}
+
@end