pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
changeset 3521 2628538df4d5
parent 3514 9a4b16d7434d
child 3522 9326deae631d
equal deleted inserted replaced
3520:029110350584 3521:2628538df4d5
   151         }
   151         }
   152         guard let row = saveModel.row(for: indexPath) else {
   152         guard let row = saveModel.row(for: indexPath) else {
   153             Log.shared.errorAndCrash(component: #function, errorString: "We should have a row here")
   153             Log.shared.errorAndCrash(component: #function, errorString: "We should have a row here")
   154             return
   154             return
   155         }
   155         }
       
   156         guard let folder = folderToShow else {
       
   157             Log.shared.errorAndCrash(component: #function, errorString: "No folder")
       
   158             return
       
   159         }
       
   160         if folder.folderType == .drafts {
       
   161             // Mails in drafts folder can only be opened in compose mode, which is shown modally.
       
   162             cell.accessoryDisclosureIndicator.isHidden = true
       
   163         }
   156         cell.senderLabel.text = row.from
   164         cell.senderLabel.text = row.from
   157         cell.subjectLabel.text = row.subject
   165         cell.subjectLabel.text = row.subject
   158         cell.summaryLabel.text = row.bodyPeek
   166         cell.summaryLabel.text = row.bodyPeek
   159         cell.isFlagged = row.isFlagged
   167         cell.isFlagged = row.isFlagged
   160         cell.isSeen = row.isSeen
   168         cell.isSeen = row.isSeen
   161         cell.hasAttachment = row.showAttchmentIcon
   169         cell.hasAttachment = row.showAttchmentIcon
   162         cell.dateLabel.text = row.dateText
   170         cell.dateLabel.text = row.dateText
   163         // Set image from cache if any
   171         // Set image from cache if any
   164         cell.setContactImage(image: row.senderContactImage)
   172         cell.setContactImage(image: row.senderContactImage)
   165         
   173 
   166         let op = BlockOperation() { [weak self] in
   174         let op = BlockOperation() { [weak self] in
   167             MessageModel.performAndWait {
   175             MessageModel.performAndWait {
   168                 // ... and expensive computations in background
   176                 // ... and expensive computations in background
   169                 guard let strongSelf = self else {
   177                 guard let strongSelf = self else {
   170                     // View is gone, nothing to do.
   178                     // View is gone, nothing to do.