summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/JuickNavigationController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-10-02 21:00:34 +0300
committerGravatar Vitaly Takmazov2019-10-02 21:00:34 +0300
commite463896f7cab7eb9482085cf39a025e83408a14c (patch)
tree6f3473b34e1893d987144a55d8d9c8480269bfb7 /Juick/ViewControllers/JuickNavigationController.m
parent633abd8498f2ef52d7e2989e111d55012053ad74 (diff)
Cleanup notifications
Diffstat (limited to 'Juick/ViewControllers/JuickNavigationController.m')
-rw-r--r--Juick/ViewControllers/JuickNavigationController.m26
1 files changed, 19 insertions, 7 deletions
diff --git a/Juick/ViewControllers/JuickNavigationController.m b/Juick/ViewControllers/JuickNavigationController.m
index a066dbd..8673866 100644
--- a/Juick/ViewControllers/JuickNavigationController.m
+++ b/Juick/ViewControllers/JuickNavigationController.m
@@ -12,6 +12,7 @@
#import "APIClient.h"
#import "MessagesViewController.h"
#import "ThreadViewController.h"
+#import "NewPostViewController.h"
#import "Message.h"
@@ -43,19 +44,30 @@
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"threadSegue"]) {
- if ([sender isKindOfClass:[MessagesViewController class]]) {
+ ThreadViewController *threadVC = (ThreadViewController *)segue.destinationViewController;
+ [threadVC setShouldScrollToUnreadOnRefresh:NO];
+ NSNumber *pushedThread = [AppDelegate shared].pushedThread;
+ if (pushedThread) {
+ [threadVC setParams:@{@"mid": pushedThread }];
+ if ([AppDelegate shared].pushedReplyId) {
+ [threadVC setFirstUnread:[AppDelegate shared].pushedReplyId];
+ [threadVC setShouldScrollToUnreadOnRefresh:YES];
+ }
+ } else {
MessagesViewController *vc = (MessagesViewController *) sender;
Message *msg = vc.messages[vc.tableView.indexPathForSelectedRow.row];
- ThreadViewController *threadVC = (ThreadViewController *)segue.destinationViewController;
[threadVC setMessages:[@[msg] mutableCopy]];
[threadVC setParams:@{@"mid": msg.mid }];
[threadVC setShouldScrollToUnreadOnRefresh:NO];
}
- /*
- if (rid) {
- [threadVC setFirstUnread:rid];
- [threadVC setShouldScrollToUnreadOnRefresh:YES];
- }*/
+ }
+ if ([segue.identifier isEqualToString:@"editorSegue"]) {
+ if ([sender isKindOfClass:[ThreadViewController class]]) {
+ ThreadViewController *thread = (ThreadViewController *) sender;
+ Message *msg = [thread.messages objectAtIndex:[thread.tableView indexPathForSelectedRow].row];
+ NewPostViewController *postVC = [[((UINavigationController *)segue.destinationViewController) viewControllers] firstObject];
+ [postVC setReplyTo:msg];
+ }
}
}