pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 2715 50b73f5ea496
parent 2697 a9130d482e40
child 2733 d11889937bcc
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Mon Aug 14 10:50:30 2017 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Mon Aug 14 12:05:13 2017 +0200
     1.3 @@ -335,7 +335,7 @@
     1.4      func createReplyAction(cell: EmailListViewCell) ->  UIAlertAction {
     1.5          return UIAlertAction(title: "Reply", style: .default) { (action) in
     1.6              // self.performSegue(withIdentifier: self.segueCompose, sender: cell)
     1.7 -            self.performSegue(withIdentifier: .segueCompose, sender: cell)
     1.8 +            self.performSegue(withIdentifier: .segueReply, sender: cell)
     1.9          }
    1.10      }
    1.11  
    1.12 @@ -383,6 +383,7 @@
    1.13          case segueEditAccounts
    1.14          case segueShowEmail
    1.15          case segueCompose
    1.16 +        case segueReply
    1.17          case segueReplyAll
    1.18          case segueForward
    1.19          case segueFilter
    1.20 @@ -392,6 +393,16 @@
    1.21  
    1.22      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    1.23          switch segueIdentifier(for: segue) {
    1.24 +        case .segueReply:
    1.25 +            if let nav = segue.destination as? UINavigationController,
    1.26 +                let destination = nav.topViewController as? ComposeTableViewController,
    1.27 +                let cell = sender as? EmailListViewCell,
    1.28 +                let indexPath = self.tableView.indexPath(for: cell),
    1.29 +                let email = cell.messageAt(indexPath: indexPath, config: config) {
    1.30 +                destination.composeMode = .replyFrom
    1.31 +                destination.appConfig = config?.appConfig
    1.32 +                destination.originalMessage = email
    1.33 +            }
    1.34          case .segueReplyAll:
    1.35              if let nav = segue.destination as? UINavigationController,
    1.36                  let destination = nav.topViewController as? ComposeTableViewController,