IOS-1495 merge from default IOS-1495
authorXavier Algarra <xavier@pep-project.org>
Mon, 18 Mar 2019 15:02:23 +0100
branchIOS-1495
changeset 801760971e1b8ab6
parent 8013 b4b7750a4648
parent 7975 0687a4a6d8c2
child 8026 259363934338
IOS-1495 merge from default
pEpForiOS/UI/EmailDisplayList/EmailListViewModel+EmailDisplayDelegate.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageFolderDelegate.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift
pEpForiOSTests/Models/EmailListViewModelTest.swift
     1.1 --- a/pEpForiOS/Background/DecryptMessagesOperation.swift	Fri Mar 15 19:38:01 2019 +0100
     1.2 +++ b/pEpForiOS/Background/DecryptMessagesOperation.swift	Mon Mar 18 15:02:23 2019 +0100
     1.3 @@ -233,7 +233,7 @@
     1.4              Logger.backendLogger.errorAndCrash("Error converting CDMesage")
     1.5              return
     1.6          }
     1.7 -        MessageModelConfig.messageFolderDelegate?.didCreate(messageFolder: message)
     1.8 +        MessageModelConfig.messageFolderDelegate?.didCreate(message: message)
     1.9      }
    1.10  
    1.11      // MARK: - Handle DecryptMessageOperationDelegate Calls
     2.1 --- a/pEpForiOS/Background/EncryptAndSendOperation.swift	Fri Mar 15 19:38:01 2019 +0100
     2.2 +++ b/pEpForiOS/Background/EncryptAndSendOperation.swift	Mon Mar 18 15:02:23 2019 +0100
     2.3 @@ -118,7 +118,7 @@
     2.4                  return
     2.5          }
     2.6          let rating = message.outgoingMessageRating().rawValue
     2.7 -        MessageModelConfig.messageFolderDelegate?.didDelete(messageFolder: message)
     2.8 +        MessageModelConfig.messageFolderDelegate?.didDelete(message: message)
     2.9          cdMessage.parent = sentFolder
    2.10          cdMessage.imap?.localFlags?.flagSeen = true
    2.11          cdMessage.pEpRating = Int16(rating)
     3.1 --- a/pEpForiOS/Models/CdMessage+Pantomime.swift	Fri Mar 15 19:38:01 2019 +0100
     3.2 +++ b/pEpForiOS/Models/CdMessage+Pantomime.swift	Mon Mar 18 15:02:23 2019 +0100
     3.3 @@ -325,14 +325,13 @@
     3.4       * If there were no local flag changes (in respect to the previous server flags version),
     3.5       the local flags will then be set to the same value.
     3.6       * If there were local changes, then the local flags will not change.
     3.7 -     - Returns: true if the local flags were updated.
     3.8       */
     3.9 -    public func updateFromServer(cwFlags: CWFlags) -> Bool {
    3.10 +    public func updateFromServer(cwFlags: CWFlags) {
    3.11          // Since we frequently sync the flags, don't modify anything
    3.12          // if the version from the server has already been known,
    3.13          // since this could overwrite changes just made by the user.
    3.14          if cwFlags.rawFlagsAsShort() == imap?.serverFlags?.rawFlagsAsShort() {
    3.15 -            return false
    3.16 +            return
    3.17          }
    3.18  
    3.19          let theImap = imapFields()
    3.20 @@ -346,26 +345,23 @@
    3.21          let localFlags = theImap.localFlags ?? CdImapFlags.create()
    3.22          theImap.localFlags = localFlags
    3.23  
    3.24 -        var changedLocalFlags = false
    3.25          if haveLocalChanges {
    3.26 -            changedLocalFlags =  mergeOnConflict(localFlags: localFlags, serverFlags: serverFlags,
    3.27 -                                                 newServerFlags: cwFlags)
    3.28 +            mergeOnConflict(localFlags: localFlags, serverFlags: serverFlags,
    3.29 +                            newServerFlags: cwFlags)
    3.30          } else {
    3.31              localFlags.update(cwFlags: cwFlags)
    3.32 -            changedLocalFlags = true
    3.33          }
    3.34  
    3.35          serverFlags.update(cwFlags: cwFlags)
    3.36 -
    3.37 -        return changedLocalFlags
    3.38      }
    3.39  
    3.40      /**
    3.41       Tries to merge IMAP flags, basically taking into
    3.42       account which flags were changed locally if it makes any difference.
    3.43       */
    3.44 -    func mergeOnConflict(localFlags: CdImapFlags, serverFlags: CdImapFlags,
    3.45 -                         newServerFlags: CWFlags) -> Bool {
    3.46 +    func mergeOnConflict(localFlags: CdImapFlags,
    3.47 +                         serverFlags: CdImapFlags,
    3.48 +                         newServerFlags: CWFlags) {
    3.49          localFlags.flagAnswered = localFlags.flagAnswered || serverFlags.flagAnswered ||
    3.50              newServerFlags.contain(.answered)
    3.51          localFlags.flagDraft = localFlags.flagDraft || serverFlags.flagDraft ||
    3.52 @@ -379,7 +375,6 @@
    3.53          }
    3.54          localFlags.flagDeleted = localFlags.flagDeleted || serverFlags.flagDeleted ||
    3.55              newServerFlags.contain(.deleted)
    3.56 -        return localFlags.rawFlagsAsShort() != newServerFlags.rawFlagsAsShort()
    3.57      }
    3.58  
    3.59      /**
    3.60 @@ -416,11 +411,8 @@
    3.61              return mail
    3.62          }
    3.63          
    3.64 -        if mail.updateFromServer(cwFlags: message.flags()) {
    3.65 -            if mail.pEpRating != pEpRatingNone {
    3.66 -                mail.serialNumber = mail.serialNumber + 1
    3.67 -            }
    3.68 -        }
    3.69 +        mail.updateFromServer(cwFlags: message.flags())
    3.70 +
    3.71          // Bail out quickly if there is only a flag change needed
    3.72          if messageUpdate.isFlagsOnly() {
    3.73              guard isUpdate else {
    3.74 @@ -437,7 +429,6 @@
    3.75          
    3.76          if !moreMessagesThanRequested(mail: mail, messageUpdate: messageUpdate) {
    3.77              mail.parent = folder
    3.78 -            mail.bodyFetched = message.isInitialized()
    3.79              mail.sent = message.originationDate()
    3.80              mail.shortMessage = message.subject()
    3.81              
    3.82 @@ -462,10 +453,9 @@
    3.83              return
    3.84          }
    3.85          if !flags.deleted {
    3.86 -            MessageModelConfig.messageFolderDelegate?.didUpdate(messageFolder: msg)
    3.87 +            MessageModelConfig.messageFolderDelegate?.didUpdate(message: msg)
    3.88          } else {
    3.89 -            MessageModelConfig.messageFolderDelegate?.didDelete(
    3.90 -                messageFolder: msg)
    3.91 +            MessageModelConfig.messageFolderDelegate?.didDelete(message: msg)
    3.92          }
    3.93      }
    3.94  
    3.95 @@ -475,13 +465,11 @@
    3.96       (e.g., parsing of HTML and/or attachments).
    3.97       - Parameter message: The pantomime message to insert.
    3.98       - Parameter account: The account this email is supposed to be stored for.
    3.99 -     - Parameter forceParseAttachments: If true, this will parse the attachments even
   3.100 -     if the pantomime has not been initialized yet (useful for testing).
   3.101       - Returns: The newly created or updated Message
   3.102       */
   3.103 -    public static func insertOrUpdate( pantomimeMessage: CWIMAPMessage, account: CdAccount,
   3.104 -                                       messageUpdate: CWMessageUpdate,
   3.105 -                                       forceParseAttachments: Bool = false) -> CdMessage? {
   3.106 +    public static func insertOrUpdate(pantomimeMessage: CWIMAPMessage,
   3.107 +                                      account: CdAccount,
   3.108 +                                      messageUpdate: CWMessageUpdate) -> CdMessage? {
   3.109          objc_sync_enter(self)
   3.110          defer { objc_sync_exit(self) }
   3.111          
   3.112 @@ -516,8 +504,6 @@
   3.113              mail.from = cdIdentity(pantomimeAddress: from)
   3.114          }
   3.115  
   3.116 -        mail.bodyFetched = pantomimeMessage.isInitialized()
   3.117 -
   3.118          if let addresses = pantomimeMessage.recipients() as? [CWInternetAddress] {
   3.119              let tos: NSMutableOrderedSet = []
   3.120              let ccs: NSMutableOrderedSet = []
   3.121 @@ -563,11 +549,7 @@
   3.122          // accidentally made its way until here.
   3.123          // Do *not* add the attachments again.
   3.124          if !containsAttachments(cdMessage: mail) {
   3.125 -            if forceParseAttachments || mail.bodyFetched {
   3.126 -                // Parsing attachments only makes sense once pantomime has received the
   3.127 -                // mail body. Same goes for the snippet.
   3.128 -                addAttachmentsFromPantomimePart(pantomimeMessage, targetMail: mail)
   3.129 -            }
   3.130 +            addAttachmentsFromPantomimePart(pantomimeMessage, targetMail: mail)
   3.131          }
   3.132  
   3.133          store(headerFieldNames: ["X-pEp-Version", "X-EncStatus", "X-KeyList"],
   3.134 @@ -577,7 +559,7 @@
   3.135          Record.saveAndWait()
   3.136          if mail.pEpRating != PEPUtil.pEpRatingNone,
   3.137              let msg = mail.message() {
   3.138 -            MessageModelConfig.messageFolderDelegate?.didCreate(messageFolder: msg)
   3.139 +            MessageModelConfig.messageFolderDelegate?.didCreate(message: msg)
   3.140          }
   3.141  
   3.142          return mail
     4.1 --- a/pEpForiOS/Models/CdMessage+pEp.swift	Fri Mar 15 19:38:01 2019 +0100
     4.2 +++ b/pEpForiOS/Models/CdMessage+pEp.swift	Mon Mar 18 15:02:23 2019 +0100
     4.3 @@ -26,8 +26,6 @@
     4.4              update(rating: theRating)
     4.5          }
     4.6  
     4.7 -        bodyFetched = true
     4.8 -
     4.9          shortMessage = (pEpMessageDict[kPepShortMessage] as? String)?.applyingDos2Unix()
    4.10          longMessage = (pEpMessageDict[kPepLongMessage] as? String)?.applyingDos2Unix()
    4.11          longMessageFormatted = (pEpMessageDict[kPepLongMessageFormatted]
     5.1 --- a/pEpForiOS/Models/Message+FakeMessage.swift	Fri Mar 15 19:38:01 2019 +0100
     5.2 +++ b/pEpForiOS/Models/Message+FakeMessage.swift	Mon Mar 18 15:02:23 2019 +0100
     5.3 @@ -29,7 +29,7 @@
     5.4          fakeMsg.uuid = uuid
     5.5          CdMessage.create(withContentOf: fakeMsg)
     5.6          Record.saveAndWait()
     5.7 -        MessageModelConfig.messageFolderDelegate?.didCreate(messageFolder: fakeMsg)
     5.8 +        MessageModelConfig.messageFolderDelegate?.didCreate(message: fakeMsg)
     5.9      }
    5.10  
    5.11      static public func createCdFakeMessage(for msg: Message) {
    5.12 @@ -40,7 +40,7 @@
    5.13          fakeMsg.uuid = msg.uuid
    5.14          CdMessage.create(withContentOf: fakeMsg)
    5.15          Record.saveAndWait()
    5.16 -        MessageModelConfig.messageFolderDelegate?.didCreate(messageFolder: fakeMsg)
    5.17 +        MessageModelConfig.messageFolderDelegate?.didCreate(message: fakeMsg)
    5.18      }
    5.19  
    5.20      func saveFakeMessage(in targetFolder: Folder) {
     6.1 --- a/pEpForiOS/Models/UnifiedInbox.swift	Fri Mar 15 19:38:01 2019 +0100
     6.2 +++ b/pEpForiOS/Models/UnifiedInbox.swift	Mon Mar 18 15:02:23 2019 +0100
     6.3 @@ -86,7 +86,7 @@
     6.4              return theFilter.fulfillsFilter(message: message)
     6.5          }
     6.6  
     6.7 -        var result = !message.isGhost && message.parent.folderType == .inbox
     6.8 +        var result = !(message.imapFlags?.deleted ?? false) && message.parent.folderType == .inbox
     6.9          if !markedForMoveToFolderAreContained {
    6.10              result =
    6.11                  result && (message.targetFolder == nil || message.targetFolder == message.parent)
     7.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift	Fri Mar 15 19:38:01 2019 +0100
     7.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageQueryResultsDelegate.swift	Mon Mar 18 15:02:23 2019 +0100
     7.3 @@ -7,6 +7,7 @@
     7.4  //
     7.5  
     7.6  import Foundation
     7.7 +import MessageModel
     7.8  
     7.9  extension EmailListViewModel : MessageQueryResultsDelegate {
    7.10      
     8.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Fri Mar 15 19:38:01 2019 +0100
     8.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Mon Mar 18 15:02:23 2019 +0100
     8.3 @@ -122,7 +122,7 @@
     8.4              return false
     8.5          }
     8.6      }
     8.7 -    
     8.8 +
     8.9      //check if there are some important settings that have changed to force a reload
    8.10      func checkIfSettingsChanged() -> Bool {
    8.11          if AppSettings.threadedViewEnabled != oldThreadSetting {
    8.12 @@ -647,66 +647,3 @@
    8.13          }
    8.14      }
    8.15  }
    8.16 -
    8.17 -
    8.18 -//!!!: Mock to be removed
    8.19 -public class MessageQueryResults {
    8.20 -    let f : Folder
    8.21 -    required init(withFolder folder: Folder) {
    8.22 -        f = folder
    8.23 -    }
    8.24 -
    8.25 -    var delegate: MessageQueryResultsDelegate?
    8.26 -
    8.27 -    var count: Int {
    8.28 -        return 0
    8.29 -    }
    8.30 -
    8.31 -    subscript(index: Int) -> Message {
    8.32 -        return Message(uuid: UUID.init().uuidString, parentFolder: f)
    8.33 -    }
    8.34 -
    8.35 -    func startMonitoring() throws {
    8.36 -
    8.37 -    }
    8.38 -
    8.39 -    func set(filter: MessageQueryResultsFilter?) throws {
    8.40 -
    8.41 -    }
    8.42 -
    8.43 -    func set(search: MessageQueryResultsSearch?) throws {
    8.44 -
    8.45 -    }
    8.46 -}
    8.47 -
    8.48 -
    8.49 -/// Subscribers must conform to get notified about messages updates.
    8.50 -///
    8.51 -/// Note: filter and search should not be set, during updating results. That means after
    8.52 -/// willChangeResults was call, and before didChangeResults is calls.
    8.53 -///
    8.54 -protocol MessageQueryResultsDelegate: class {
    8.55 -    /// Call when an insert have been done in the results
    8.56 -    /// - Parameter indexPath: indexPath of the new element inserted
    8.57 -    func didInsert(indexPath: IndexPath)
    8.58 -
    8.59 -    /// Call when an element have been modify in the results
    8.60 -    /// - Parameter indexPath: indexPath of the modified element
    8.61 -    func didUpdate(indexPath: IndexPath)
    8.62 -
    8.63 -    /// Call when an element have been deleted of the results
    8.64 -    /// - Parameter indexPath: indexPath of the deleted element
    8.65 -    func didDelete(indexPath: IndexPath)
    8.66 -
    8.67 -    /// Call when an element have change position (moved) inside of the results
    8.68 -    /// - Parameter from: original indexPath of the moved element
    8.69 -    /// - Parameter to: destination indexPath of the moved element
    8.70 -    func didMove(from: IndexPath, to: IndexPath)
    8.71 -
    8.72 -    /// Notifies the receiver that there will be one or more updates due to an insert, remove,
    8.73 -    /// move, or update.
    8.74 -    func willChangeResults()
    8.75 -
    8.76 -    /// Notifies the receiver that all updates have been completed. Results is updated
    8.77 -    func didChangeResults()
    8.78 -}
     9.1 --- a/pEpForiOSTests/Background/DercyptMessagesOperationTest.swift	Fri Mar 15 19:38:01 2019 +0100
     9.2 +++ b/pEpForiOSTests/Background/DercyptMessagesOperationTest.swift	Mon Mar 18 15:02:23 2019 +0100
     9.3 @@ -33,10 +33,10 @@
     9.4          message.setUID(1)
     9.5          guard let msg = CdMessage.insertOrUpdate(  pantomimeMessage: message,
     9.6                                                     account: cdAccount,
     9.7 -                                                   messageUpdate: CWMessageUpdate.newComplete(),
     9.8 -                                                   forceParseAttachments: true) else {
     9.9 -                                                    XCTFail("error parsing message")
    9.10 -                                                    return
    9.11 +                                                   messageUpdate: CWMessageUpdate.newComplete())
    9.12 +            else {
    9.13 +                XCTFail("error parsing message")
    9.14 +                return
    9.15          }
    9.16  
    9.17          guard let cur = CdMessage.search(message: message, inAccount: cdAccount) else {
    10.1 --- a/pEpForiOSTests/DecryptionTestsInternal.swift	Fri Mar 15 19:38:01 2019 +0100
    10.2 +++ b/pEpForiOSTests/DecryptionTestsInternal.swift	Mon Mar 18 15:02:23 2019 +0100
    10.3 @@ -174,9 +174,7 @@
    10.4          }
    10.5  
    10.6          cdMsg.parent = cdInbox
    10.7 -        cdMsg.bodyFetched = true
    10.8  
    10.9 -        XCTAssertTrue(cdMsg.bodyFetched)
   10.10          XCTAssertFalse(cdMsg.imap?.localFlags?.flagDeleted ?? true)
   10.11          XCTAssertEqual(cdMsg.pEpRating, PEPUtil.pEpRatingNone)
   10.12          if shouldEncrypt {
    11.1 --- a/pEpForiOSTests/Models/CdMessage+PantomimeTest.swift	Fri Mar 15 19:38:01 2019 +0100
    11.2 +++ b/pEpForiOSTests/Models/CdMessage+PantomimeTest.swift	Mon Mar 18 15:02:23 2019 +0100
    11.3 @@ -155,15 +155,13 @@
    11.4          }
    11.5          message.setFolder(CWIMAPFolder(name: ImapSync.defaultImapInboxName))
    11.6          let msg = CdMessage.insertOrUpdate(
    11.7 -            pantomimeMessage: message, account: cdAccount, messageUpdate: CWMessageUpdate(),
    11.8 -            forceParseAttachments: true)
    11.9 +            pantomimeMessage: message, account: cdAccount, messageUpdate: CWMessageUpdate())
   11.10          XCTAssertNotNil(msg)
   11.11          if let m = msg {
   11.12              XCTAssertNotNil(m.longMessage)
   11.13              XCTAssertNotNil(m.longMessageFormatted)
   11.14          }
   11.15      }
   11.16 -    
   11.17  
   11.18      //IOS-211 hi_there
   11.19      func testInsertOrUpdatePantomimeMessage_attachmentNotDuplicated_file1() {
   11.20 @@ -180,8 +178,7 @@
   11.21          }
   11.22          message.setFolder(CWIMAPFolder(name: ImapSync.defaultImapInboxName))
   11.23          guard let _ = CdMessage.insertOrUpdate(
   11.24 -            pantomimeMessage: message, account: cdAccount, messageUpdate: CWMessageUpdate(),
   11.25 -            forceParseAttachments: true) else {
   11.26 +            pantomimeMessage: message, account: cdAccount, messageUpdate: CWMessageUpdate()) else {
   11.27                  XCTFail("error parsing message")
   11.28                  return
   11.29          }
   11.30 @@ -210,8 +207,7 @@
   11.31          }
   11.32          message.setFolder(CWIMAPFolder(name: ImapSync.defaultImapInboxName))
   11.33          guard let _ = CdMessage.insertOrUpdate(
   11.34 -            pantomimeMessage: message, account: cdAccount, messageUpdate: CWMessageUpdate(),
   11.35 -            forceParseAttachments: true) else {
   11.36 +            pantomimeMessage: message, account: cdAccount, messageUpdate: CWMessageUpdate()) else {
   11.37                  XCTFail("error parsing message")
   11.38                  return
   11.39          }
   11.40 @@ -233,7 +229,7 @@
   11.41          localFlags.flagFlagged = true
   11.42          cwFlags.add(.seen)
   11.43          XCTAssertTrue(cwFlags.contain(.seen))
   11.44 -        XCTAssertTrue(m.updateFromServer(cwFlags: cwFlags))
   11.45 +        m.updateFromServer(cwFlags: cwFlags)
   11.46          XCTAssertTrue(localFlags.flagFlagged)
   11.47          XCTAssertTrue(localFlags.flagSeen)
   11.48          XCTAssertEqual(serverFlags.rawFlagsAsShort(), cwFlags.rawFlagsAsShort())
   11.49 @@ -241,7 +237,7 @@
   11.50          // No user action, server adds .seen -> .seen locally
   11.51          localFlags.reset()
   11.52          serverFlags.reset()
   11.53 -        XCTAssertTrue(m.updateFromServer(cwFlags: cwFlags))
   11.54 +        m.updateFromServer(cwFlags: cwFlags)
   11.55          XCTAssertTrue(localFlags.flagSeen)
   11.56          XCTAssertEqual(serverFlags.rawFlagsAsShort(), cwFlags.rawFlagsAsShort())
   11.57  
   11.58 @@ -251,7 +247,7 @@
   11.59          cwFlags.removeAll()
   11.60          cwFlags.add(.flagged)
   11.61          serverFlags.flagFlagged = true
   11.62 -        XCTAssertFalse(m.updateFromServer(cwFlags: cwFlags))
   11.63 +        m.updateFromServer(cwFlags: cwFlags)
   11.64          XCTAssertFalse(localFlags.flagFlagged)
   11.65          XCTAssertEqual(serverFlags.rawFlagsAsShort(), cwFlags.rawFlagsAsShort())
   11.66  
   11.67 @@ -262,7 +258,7 @@
   11.68          cwFlags.add(.recent)
   11.69          cwFlags.add(.flagged)
   11.70          serverFlags.flagRecent = true
   11.71 -        XCTAssertFalse(m.updateFromServer(cwFlags: cwFlags))
   11.72 +        m.updateFromServer(cwFlags: cwFlags)
   11.73          XCTAssertTrue(localFlags.flagRecent)
   11.74          XCTAssertTrue(localFlags.flagFlagged)
   11.75          XCTAssertEqual(serverFlags.rawFlagsAsShort(), cwFlags.rawFlagsAsShort())
    12.1 --- a/pEpForiOSTests/NetworkServiceTests.swift	Fri Mar 15 19:38:01 2019 +0100
    12.2 +++ b/pEpForiOSTests/NetworkServiceTests.swift	Mon Mar 18 15:02:23 2019 +0100
    12.3 @@ -268,23 +268,19 @@
    12.4              }
    12.5          }
    12.6  
    12.7 -        func didUpdate(messageFolder: MessageFolder) {
    12.8 -            if let msg = messageFolder as? Message {
    12.9 -                // messages has been changed during the test
   12.10 -                XCTAssertNotNil(messagesByID[msg.messageID])
   12.11 -                add(message: msg)
   12.12 -                changedMessagesByID[msg.messageID] = msg
   12.13 -            }
   12.14 +        func didUpdate(message: Message) {
   12.15 +            // messages has been changed during the test
   12.16 +            XCTAssertNotNil(messagesByID[message.messageID])
   12.17 +            add(message: message)
   12.18 +            changedMessagesByID[message.messageID] = message
   12.19          }
   12.20  
   12.21 -        func didDelete(messageFolder: MessageFolder) {
   12.22 +        func didDelete(message: Message) {
   12.23              // this message has been deleted from the start, ignore
   12.24          }
   12.25  
   12.26 -        func didCreate(messageFolder: MessageFolder) {
   12.27 -            if let msg = messageFolder as? Message {
   12.28 -                add(message: msg)
   12.29 -            }
   12.30 +        func didCreate(message: Message) {
   12.31 +            add(message: message)
   12.32          }
   12.33      }
   12.34  }
    13.1 --- a/pEpForiOSTests/SimpleOperationsTest.swift	Fri Mar 15 19:38:01 2019 +0100
    13.2 +++ b/pEpForiOSTests/SimpleOperationsTest.swift	Mon Mar 18 15:02:23 2019 +0100
    13.3 @@ -15,7 +15,7 @@
    13.4  class SimpleOperationsTest: CoreDataDrivenTestBase {
    13.5      func testComp() {
    13.6          guard let f = SyncFoldersFromServerOperation(parentName: #function,
    13.7 -                                                                 imapSyncData: imapSyncData)
    13.8 +                                                     imapSyncData: imapSyncData)
    13.9              else {
   13.10                  XCTFail()
   13.11                  return
    14.1 --- a/pEpForiOSTests/TestUtils/TestUtil.swift	Fri Mar 15 19:38:01 2019 +0100
    14.2 +++ b/pEpForiOSTests/TestUtils/TestUtil.swift	Mon Mar 18 15:02:23 2019 +0100
    14.3 @@ -734,8 +734,7 @@
    14.4  
    14.5              guard let cdMessage = CdMessage.insertOrUpdate(
    14.6                  pantomimeMessage: pantomimeMail, account: cdMyAccount,
    14.7 -                messageUpdate: CWMessageUpdate(),
    14.8 -                forceParseAttachments: true) else {
    14.9 +                messageUpdate: CWMessageUpdate()) else {
   14.10                      XCTFail()
   14.11                      return nil
   14.12              }
   14.13 @@ -802,8 +801,7 @@
   14.14  
   14.15          guard let cdMessage = CdMessage.insertOrUpdate(
   14.16              pantomimeMessage: pantomimeMail, account: cdOwnAccount,
   14.17 -            messageUpdate: CWMessageUpdate(),
   14.18 -            forceParseAttachments: true) else {
   14.19 +            messageUpdate: CWMessageUpdate()) else {
   14.20                  XCTFail()
   14.21                  return nil
   14.22          }
    15.1 --- a/pEpForiOSTests/UI/Compose/ViewModel/ComposeViewModelStateTest.swift	Fri Mar 15 19:38:01 2019 +0100
    15.2 +++ b/pEpForiOSTests/UI/Compose/ViewModel/ComposeViewModelStateTest.swift	Mon Mar 18 15:02:23 2019 +0100
    15.3 @@ -12,8 +12,6 @@
    15.4  import MessageModel
    15.5  
    15.6  class ComposeViewModelStateTest: CoreDataDrivenTestBase {
    15.7 -    /// Async PEPSession calls that take quite some time
    15.8 -    let asyncPEPSessionCallWaitTime = 2.0
    15.9      private var testDelegate: TestDelegate?
   15.10      var testee: ComposeViewModel.ComposeViewModelState?
   15.11      var draftedMessageAllButBccSet: Message?
   15.12 @@ -101,7 +99,7 @@
   15.13          assertValidatation(expectedStateIsValid: false,
   15.14                             expectedNewRating: nil)
   15.15          testee?.toRecipients = recipients
   15.16 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.17 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.18      }
   15.19  
   15.20      func testValidate_changeTos_grey() {
   15.21 @@ -109,7 +107,7 @@
   15.22          assertValidatation(expectedStateIsValid: true,
   15.23                             expectedNewRating: PEP_rating_unencrypted)
   15.24          testee?.toRecipients = recipients
   15.25 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.26 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.27      }
   15.28  
   15.29      func testValidate_changeTos_green() {
   15.30 @@ -117,7 +115,7 @@
   15.31          assertValidatation(expectedStateIsValid: true,
   15.32                             expectedNewRating: PEP_rating_trusted_and_anonymized)
   15.33          testee?.toRecipients = recipients
   15.34 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.35 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.36      }
   15.37  
   15.38      func testValidate_changeCcs_grey() {
   15.39 @@ -125,7 +123,7 @@
   15.40          assertValidatation(expectedStateIsValid: true,
   15.41                             expectedNewRating: PEP_rating_unencrypted)
   15.42          testee?.ccRecipients = recipients
   15.43 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.44 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.45      }
   15.46  
   15.47      func testValidate_changeCCs_green() {
   15.48 @@ -133,7 +131,7 @@
   15.49          assertValidatation(expectedStateIsValid: true,
   15.50                             expectedNewRating: PEP_rating_trusted_and_anonymized)
   15.51          testee?.ccRecipients = recipients
   15.52 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.53 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.54      }
   15.55  
   15.56      // MARK: - edited
   15.57 @@ -227,7 +225,7 @@
   15.58          assertValidatation(expectedStateIsValid: true,
   15.59                             expectedNewRating: PEP_rating_trusted_and_anonymized)
   15.60          testee?.toRecipients = recipients
   15.61 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.62 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.63          // ... and assert can toggle works correctly
   15.64          guard let canToggleProtection = testee?.userCanToggleProtection() else {
   15.65              XCTFail()
   15.66 @@ -244,7 +242,7 @@
   15.67          assertValidatation(expectedStateIsValid: true,
   15.68                             expectedNewRating: PEP_rating_trusted_and_anonymized)
   15.69          testee?.toRecipients = recipients
   15.70 -        waitForExpectations(timeout: asyncPEPSessionCallWaitTime)
   15.71 +        waitForExpectations(timeout: UnitTestUtils.asyncWaitTime)
   15.72          // ... set BCC ...
   15.73          testDelegate?.ignoreAll = true
   15.74          testee?.bccRecipients = recipients