IOS-234 Skeleton for saving drafts (to be fleshed out) IOS-230
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 25 Oct 2016 09:47:36 +0200
branchIOS-230
changeset 86789ccccb16970
parent 861 53c7f9ec0dec
child 868 0664f5352a31
IOS-234 Skeleton for saving drafts (to be fleshed out)
pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Mon Oct 24 17:15:14 2016 +0200
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Tue Oct 25 09:47:36 2016 +0200
     1.3 @@ -111,14 +111,26 @@
     1.4      }
     1.5  
     1.6      @IBAction func backFromComposeSaveDraftSegue(_ segue: UIStoryboardSegue) {
     1.7 -        guard let _ = draftMessageToStore else {
     1.8 +        guard let message = draftMessageToStore else {
     1.9              return
    1.10          }
    1.11  
    1.12          state.isSynching = true
    1.13          updateUI()
    1.14  
    1.15 +        message.imapFlags.draft = true
    1.16 +
    1.17          // TODO: IOS 222: Save as draft
    1.18 +        if let folder = draftMessageToStore?.parent as? Folder {
    1.19 +            if folder.folderType == .drafts {
    1.20 +                message.save()
    1.21 +                return
    1.22 +            }
    1.23 +        }
    1.24 +
    1.25 +        guard let account = config.account else {
    1.26 +            return
    1.27 +        }
    1.28      }
    1.29  
    1.30      func updateModel() {