IOS-643 reply action on mail list view controller works correctly
authorXavier Algarra <xavier@pep-project.org>
Mon, 14 Aug 2017 12:05:13 +0200
changeset 271550b73f5ea496
parent 2714 b135d28c3614
child 2716 b0d2e3488406
IOS-643 reply action on mail list view controller works correctly
pEpForiOS/Base.lproj/Main.storyboard
pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
     1.1 --- a/pEpForiOS/Base.lproj/Main.storyboard	Mon Aug 14 10:50:30 2017 +0200
     1.2 +++ b/pEpForiOS/Base.lproj/Main.storyboard	Mon Aug 14 12:05:13 2017 +0200
     1.3 @@ -166,6 +166,7 @@
     1.4                          <segue destination="Rly-af-89k" kind="presentation" identifier="segueAddNewAccount" id="Na7-CM-lbe"/>
     1.5                          <segue destination="NY2-HI-4ou" kind="presentation" identifier="segueReplyAll" id="xmi-xn-p8T"/>
     1.6                          <segue destination="NY2-HI-4ou" kind="presentation" identifier="segueForward" id="YH0-dx-pSs"/>
     1.7 +                        <segue destination="NY2-HI-4ou" kind="presentation" identifier="segueReply" id="I15-Dm-oo1"/>
     1.8                      </connections>
     1.9                  </tableViewController>
    1.10                  <placeholder placeholderIdentifier="IBFirstResponder" id="d8T-vB-XpT" userLabel="First Responder" sceneMemberID="firstResponder"/>
    1.11 @@ -1036,6 +1037,6 @@
    1.12          <image name="unread-icon" width="22" height="22"/>
    1.13      </resources>
    1.14      <inferredMetricsTieBreakers>
    1.15 -        <segue reference="xmi-xn-p8T"/>
    1.16 +        <segue reference="I15-Dm-oo1"/>
    1.17      </inferredMetricsTieBreakers>
    1.18  </document>
     2.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Mon Aug 14 10:50:30 2017 +0200
     2.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Mon Aug 14 12:05:13 2017 +0200
     2.3 @@ -335,7 +335,7 @@
     2.4      func createReplyAction(cell: EmailListViewCell) ->  UIAlertAction {
     2.5          return UIAlertAction(title: "Reply", style: .default) { (action) in
     2.6              // self.performSegue(withIdentifier: self.segueCompose, sender: cell)
     2.7 -            self.performSegue(withIdentifier: .segueCompose, sender: cell)
     2.8 +            self.performSegue(withIdentifier: .segueReply, sender: cell)
     2.9          }
    2.10      }
    2.11  
    2.12 @@ -383,6 +383,7 @@
    2.13          case segueEditAccounts
    2.14          case segueShowEmail
    2.15          case segueCompose
    2.16 +        case segueReply
    2.17          case segueReplyAll
    2.18          case segueForward
    2.19          case segueFilter
    2.20 @@ -392,6 +393,16 @@
    2.21  
    2.22      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    2.23          switch segueIdentifier(for: segue) {
    2.24 +        case .segueReply:
    2.25 +            if let nav = segue.destination as? UINavigationController,
    2.26 +                let destination = nav.topViewController as? ComposeTableViewController,
    2.27 +                let cell = sender as? EmailListViewCell,
    2.28 +                let indexPath = self.tableView.indexPath(for: cell),
    2.29 +                let email = cell.messageAt(indexPath: indexPath, config: config) {
    2.30 +                destination.composeMode = .replyFrom
    2.31 +                destination.appConfig = config?.appConfig
    2.32 +                destination.originalMessage = email
    2.33 +            }
    2.34          case .segueReplyAll:
    2.35              if let nav = segue.destination as? UINavigationController,
    2.36                  let destination = nav.topViewController as? ComposeTableViewController,