IOS-1480 Import the toolbox. IOS-1480
authorDirk Zimmermann <dz@pep.security>
Thu, 21 Feb 2019 13:42:30 +0100
branchIOS-1480
changeset 1293a9f14743ac80
parent 1292 764c9cafe009
child 1294 e56317c5027a
IOS-1480 Import the toolbox.
MessageModel/MessageModel/NetworkService/IMAP/DefaultImapSyncDelegate.swift
MessageModel/MessageModel/NetworkService/IMAP/ImapFolderBuilder.swift
MessageModel/MessageModel/NetworkService/IMAP/ImapService.swift
MessageModel/MessageModel/NetworkService/Model/UnifiedInbox.swift
MessageModel/MessageModel/NetworkService/NetworkService.swift
MessageModel/MessageModel/NetworkService/NetworkServiceWorker.swift
MessageModel/MessageModel/NetworkService/Operations/AppendMailsOperation.swift
MessageModel/MessageModel/NetworkService/Operations/BaseOperation.swift
MessageModel/MessageModel/NetworkService/Operations/ConcurrentBaseOperation.swift
MessageModel/MessageModel/NetworkService/Operations/CreateRequiredFoldersOperation.swift
MessageModel/MessageModel/NetworkService/Operations/DecryptMessageOperation.swift
MessageModel/MessageModel/NetworkService/Operations/EncryptAndSendOperation.swift
MessageModel/MessageModel/NetworkService/Operations/FetchNumberOfNewMailsOperation.swift
MessageModel/MessageModel/NetworkService/Operations/FixAttachmentsOperation.swift
MessageModel/MessageModel/NetworkService/Operations/ImapSyncOperation.swift
MessageModel/MessageModel/NetworkService/Operations/LimitedOperationQueue.swift
MessageModel/MessageModel/NetworkService/Operations/MoveToFolderOperation.swift
MessageModel/MessageModel/NetworkService/Operations/MySelfOperation.swift
MessageModel/MessageModel/NetworkService/Operations/SyncFlagsToServerOperation.swift
MessageModel/MessageModel/NetworkService/Operations/SyncFoldersFromServerOperation.swift
MessageModel/MessageModel/NetworkService/Operations/SyncMessagesOperation.swift
MessageModel/MessageModel/NetworkService/Operations/UIDCopyOperation.swift
MessageModel/MessageModel/NetworkService/Service/EmailService.swift
MessageModel/MessageModel/NetworkService/Service/SmtpService.swift
MessageModel/MessageModel/NetworkService/Util/CdFolder+Extension.swift
MessageModel/MessageModel/NetworkService/Util/CdMessage+Pantomime.swift
MessageModel/MessageModel/NetworkService/Util/ConnectInfo.swift
MessageModel/MessageModel/NetworkService/Util/Folder+Imap.swift
MessageModel/MessageModel/NetworkService/Util/LegacyConnectInfoProvider.swift
MessageModel/MessageModel/NetworkService/Util/Message+IMAP.swift
MessageModel/MessageModel/NetworkService/Util/Message+pEp.swift
MessageModel/MessageModel/NetworkService/Util/MimeTypeUtil.swift
MessageModel/MessageModel/NetworkService/Util/String+Attachment.swift
     1.1 --- a/MessageModel/MessageModel/NetworkService/IMAP/DefaultImapSyncDelegate.swift	Thu Feb 21 09:20:56 2019 +0100
     1.2 +++ b/MessageModel/MessageModel/NetworkService/IMAP/DefaultImapSyncDelegate.swift	Thu Feb 21 13:42:30 2019 +0100
     1.3 @@ -6,6 +6,8 @@
     1.4  //  Copyright © 2017 p≡p Security S.A. All rights reserved.
     1.5  //
     1.6  
     1.7 +import pEpIOSToolbox
     1.8 +
     1.9  protocol ImapSyncDelegateErrorHandlerProtocol: class {
    1.10      func handle(error: Error)
    1.11  }
     2.1 --- a/MessageModel/MessageModel/NetworkService/IMAP/ImapFolderBuilder.swift	Thu Feb 21 09:20:56 2019 +0100
     2.2 +++ b/MessageModel/MessageModel/NetworkService/IMAP/ImapFolderBuilder.swift	Thu Feb 21 13:42:30 2019 +0100
     2.3 @@ -9,6 +9,7 @@
     2.4  import CoreData
     2.5  
     2.6  import PantomimeFramework
     2.7 +import pEpIOSToolbox
     2.8  
     2.9  open class ImapFolderBuilder: NSObject, CWFolderBuilding {
    2.10      public var folderNameToIgnore: String?
     3.1 --- a/MessageModel/MessageModel/NetworkService/IMAP/ImapService.swift	Thu Feb 21 09:20:56 2019 +0100
     3.2 +++ b/MessageModel/MessageModel/NetworkService/IMAP/ImapService.swift	Thu Feb 21 13:42:30 2019 +0100
     3.3 @@ -7,6 +7,7 @@
     3.4  //
     3.5  
     3.6  import PantomimeFramework
     3.7 +import pEpIOSToolbox
     3.8  
     3.9  public protocol ImapSyncDelegate: class {
    3.10      func authenticationCompleted(_ sync: ImapSync, notification: Notification?)
     4.1 --- a/MessageModel/MessageModel/NetworkService/Model/UnifiedInbox.swift	Thu Feb 21 09:20:56 2019 +0100
     4.2 +++ b/MessageModel/MessageModel/NetworkService/Model/UnifiedInbox.swift	Thu Feb 21 13:42:30 2019 +0100
     4.3 @@ -5,6 +5,8 @@
     4.4  //  Copyright © 2017 pEp Security S.A. All rights reserved.
     4.5  //
     4.6  
     4.7 +import pEpIOSToolbox
     4.8 +
     4.9  public class UnifiedInbox: Folder {
    4.10      static public let defaultUnifiedInboxName = "Unified Inbox"
    4.11  
     5.1 --- a/MessageModel/MessageModel/NetworkService/NetworkService.swift	Thu Feb 21 09:20:56 2019 +0100
     5.2 +++ b/MessageModel/MessageModel/NetworkService/NetworkService.swift	Thu Feb 21 13:42:30 2019 +0100
     5.3 @@ -8,6 +8,8 @@
     5.4  
     5.5  import Foundation
     5.6  
     5.7 +import pEpIOSToolbox
     5.8 +
     5.9  public protocol NetworkServiceDelegate: class {
    5.10      /// Called finishing the last sync loop.
    5.11      /// No further sync loop will be triggered after this call.
     6.1 --- a/MessageModel/MessageModel/NetworkService/NetworkServiceWorker.swift	Thu Feb 21 09:20:56 2019 +0100
     6.2 +++ b/MessageModel/MessageModel/NetworkService/NetworkServiceWorker.swift	Thu Feb 21 13:42:30 2019 +0100
     6.3 @@ -9,6 +9,8 @@
     6.4  import UIKit
     6.5  import CoreData
     6.6  
     6.7 +import pEpIOSToolbox
     6.8 +
     6.9  public protocol NetworkServiceWorkerDelegate: class {
    6.10      /// Called finishing the last sync loop.
    6.11      /// No further sync loop will be triggered after this call.
     7.1 --- a/MessageModel/MessageModel/NetworkService/Operations/AppendMailsOperation.swift	Thu Feb 21 09:20:56 2019 +0100
     7.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/AppendMailsOperation.swift	Thu Feb 21 13:42:30 2019 +0100
     7.3 @@ -9,6 +9,8 @@
     7.4  import UIKit
     7.5  import CoreData
     7.6  
     7.7 +import pEpIOSToolbox
     7.8 +
     7.9  /// Operation for storing mails in any type of IMAP folder.
    7.10  public class AppendMailsOperation: ImapSyncOperation {
    7.11      enum EncryptMode {
     8.1 --- a/MessageModel/MessageModel/NetworkService/Operations/BaseOperation.swift	Thu Feb 21 09:20:56 2019 +0100
     8.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/BaseOperation.swift	Thu Feb 21 13:42:30 2019 +0100
     8.3 @@ -6,6 +6,8 @@
     8.4  //  Copyright © 2016 p≡p Security S.A. All rights reserved.
     8.5  //
     8.6  
     8.7 +import pEpIOSToolbox
     8.8 +
     8.9  /**
    8.10   Basic NSOperation that can gather errors.
    8.11   */
     9.1 --- a/MessageModel/MessageModel/NetworkService/Operations/ConcurrentBaseOperation.swift	Thu Feb 21 09:20:56 2019 +0100
     9.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/ConcurrentBaseOperation.swift	Thu Feb 21 13:42:30 2019 +0100
     9.3 @@ -8,6 +8,8 @@
     9.4  
     9.5  import CoreData
     9.6  
     9.7 +import pEpIOSToolbox
     9.8 +
     9.9  /// This is the base for concurrent `NSOperation`s, that is operations that handle asynchronicity
    9.10  /// themselves, and are typically not finished when `main()` ends. Instead, they spawn their own
    9.11  /// threads or use other forms of asynchronicity.
    10.1 --- a/MessageModel/MessageModel/NetworkService/Operations/CreateRequiredFoldersOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    10.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/CreateRequiredFoldersOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    10.3 @@ -9,6 +9,8 @@
    10.4  import UIKit
    10.5  import CoreData
    10.6  
    10.7 +import pEpIOSToolbox
    10.8 +
    10.9  /**
   10.10   Checks for needed folders, like "Drafts", and when they don't exist, create them
   10.11   both locally and remote.
    11.1 --- a/MessageModel/MessageModel/NetworkService/Operations/DecryptMessageOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    11.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/DecryptMessageOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    11.3 @@ -8,6 +8,8 @@
    11.4  
    11.5  import Foundation
    11.6  
    11.7 +import pEpIOSToolbox
    11.8 +
    11.9  protocol DecryptMessageOperationDelegate: class {
   11.10  
   11.11      /// Called in case a DecryptionResult can be provided.
    12.1 --- a/MessageModel/MessageModel/NetworkService/Operations/EncryptAndSendOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    12.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/EncryptAndSendOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    12.3 @@ -8,6 +8,8 @@
    12.4  
    12.5  import CoreData
    12.6  
    12.7 +import pEpIOSToolbox
    12.8 +
    12.9  /**
   12.10   Encrypts and SMTPs all suitable messages.
   12.11   */
    13.1 --- a/MessageModel/MessageModel/NetworkService/Operations/FetchNumberOfNewMailsOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    13.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/FetchNumberOfNewMailsOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    13.3 @@ -7,7 +7,8 @@
    13.4  //
    13.5  
    13.6  import CoreData
    13.7 -import MessageModel
    13.8 +
    13.9 +import pEpIOSToolbox
   13.10  
   13.11  /// Fetches UIDs of  new (to us) messages in a given folder and returns its count.
   13.12  class FetchNumberOfNewMailsOperation: ImapSyncOperation {
    14.1 --- a/MessageModel/MessageModel/NetworkService/Operations/FixAttachmentsOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    14.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/FixAttachmentsOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    14.3 @@ -10,6 +10,8 @@
    14.4  import CoreData
    14.5  import Photos
    14.6  
    14.7 +import pEpIOSToolbox
    14.8 +
    14.9  /**
   14.10   When getting an image from the device, we might get no data but a URL to the data.
   14.11   Use this operation to (down)load attachment content before sending such an image attachment.
    15.1 --- a/MessageModel/MessageModel/NetworkService/Operations/ImapSyncOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    15.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/ImapSyncOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    15.3 @@ -6,6 +6,8 @@
    15.4  //  Copyright © 2016 p≡p Security S.A. All rights reserved.
    15.5  //
    15.6  
    15.7 +import pEpIOSToolbox
    15.8 +
    15.9  public class ImapSyncOperation: ConcurrentBaseOperation {
   15.10      let imapSyncData: ImapSyncData
   15.11  
    16.1 --- a/MessageModel/MessageModel/NetworkService/Operations/LimitedOperationQueue.swift	Thu Feb 21 09:20:56 2019 +0100
    16.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/LimitedOperationQueue.swift	Thu Feb 21 13:42:30 2019 +0100
    16.3 @@ -8,6 +8,8 @@
    16.4  
    16.5  import UIKit
    16.6  
    16.7 +import pEpIOSToolbox
    16.8 +
    16.9  /**
   16.10   A serialized `OperationQueue` that limits the number of operations in the queue to 2.
   16.11   Useful for throttling the ongoing enqueueing of the *same* operation.
    17.1 --- a/MessageModel/MessageModel/NetworkService/Operations/MoveToFolderOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    17.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/MoveToFolderOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    17.3 @@ -9,6 +9,7 @@
    17.4  import CoreData
    17.5  
    17.6  import PantomimeFramework
    17.7 +import pEpIOSToolbox
    17.8  
    17.9  /// Moves all messages in the given folder to targetFolder if parent != tagetfolder.
   17.10  class MoveToFolderOperation: ImapSyncOperation {
    18.1 --- a/MessageModel/MessageModel/NetworkService/Operations/MySelfOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    18.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/MySelfOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    18.3 @@ -9,7 +9,7 @@
    18.4  import UIKit
    18.5  import CoreData
    18.6  
    18.7 -import MessageModel
    18.8 +import pEpIOSToolbox
    18.9  
   18.10  /**
   18.11   Triggers myself on all identities who are own identities.
    19.1 --- a/MessageModel/MessageModel/NetworkService/Operations/SyncFlagsToServerOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    19.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/SyncFlagsToServerOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    19.3 @@ -9,6 +9,7 @@
    19.4  import CoreData
    19.5  
    19.6  import PantomimeFramework
    19.7 +import pEpIOSToolbox
    19.8  
    19.9  protocol SyncFlagsToServerOperationDelegate: class {
   19.10      func flagsUploaded(cdMessage: CdMessage)
    20.1 --- a/MessageModel/MessageModel/NetworkService/Operations/SyncFoldersFromServerOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    20.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/SyncFoldersFromServerOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    20.3 @@ -9,6 +9,7 @@
    20.4  import CoreData
    20.5  
    20.6  import PantomimeFramework
    20.7 +import pEpIOSToolbox
    20.8  
    20.9  protocol SyncFoldersFromServerOperationDelegate: class {
   20.10      /**
    21.1 --- a/MessageModel/MessageModel/NetworkService/Operations/SyncMessagesOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    21.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/SyncMessagesOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    21.3 @@ -9,6 +9,8 @@
    21.4  import UIKit
    21.5  import CoreData
    21.6  
    21.7 +import pEpIOSToolbox
    21.8 +
    21.9  /**
   21.10   Syncs existing messages with the servers, e.g., detecting deleted ones.
   21.11   */
    22.1 --- a/MessageModel/MessageModel/NetworkService/Operations/UIDCopyOperation.swift	Thu Feb 21 09:20:56 2019 +0100
    22.2 +++ b/MessageModel/MessageModel/NetworkService/Operations/UIDCopyOperation.swift	Thu Feb 21 13:42:30 2019 +0100
    22.3 @@ -7,6 +7,7 @@
    22.4  //
    22.5  
    22.6  import PantomimeFramework
    22.7 +import pEpIOSToolbox
    22.8  
    22.9  class UIDCopyOperation: ImapSyncOperation {
   22.10      var syncDelegate: UIDCopyOperationSyncDelegate?
    23.1 --- a/MessageModel/MessageModel/NetworkService/Service/EmailService.swift	Thu Feb 21 09:20:56 2019 +0100
    23.2 +++ b/MessageModel/MessageModel/NetworkService/Service/EmailService.swift	Thu Feb 21 13:42:30 2019 +0100
    23.3 @@ -7,6 +7,7 @@
    23.4  //
    23.5  
    23.6  import PantomimeFramework
    23.7 +import pEpIOSToolbox
    23.8  
    23.9  protocol IEmailService {
   23.10      func start()
    24.1 --- a/MessageModel/MessageModel/NetworkService/Service/SmtpService.swift	Thu Feb 21 09:20:56 2019 +0100
    24.2 +++ b/MessageModel/MessageModel/NetworkService/Service/SmtpService.swift	Thu Feb 21 13:42:30 2019 +0100
    24.3 @@ -7,6 +7,7 @@
    24.4  //
    24.5  
    24.6  import PantomimeFramework
    24.7 +import pEpIOSToolbox
    24.8  
    24.9  public protocol SmtpSendDelegate: class {
   24.10      func messageSent(_ smtp: SmtpSend, theNotification: Notification?)
    25.1 --- a/MessageModel/MessageModel/NetworkService/Util/CdFolder+Extension.swift	Thu Feb 21 09:20:56 2019 +0100
    25.2 +++ b/MessageModel/MessageModel/NetworkService/Util/CdFolder+Extension.swift	Thu Feb 21 13:42:30 2019 +0100
    25.3 @@ -8,6 +8,8 @@
    25.4  
    25.5  import CoreData
    25.6  
    25.7 +import pEpIOSToolbox
    25.8 +
    25.9  public extension CdFolder {
   25.10      @nonobjc static let comp = "CdFolder"
   25.11  
    26.1 --- a/MessageModel/MessageModel/NetworkService/Util/CdMessage+Pantomime.swift	Thu Feb 21 09:20:56 2019 +0100
    26.2 +++ b/MessageModel/MessageModel/NetworkService/Util/CdMessage+Pantomime.swift	Thu Feb 21 13:42:30 2019 +0100
    26.3 @@ -7,6 +7,7 @@
    26.4  //
    26.5  
    26.6  import PantomimeFramework
    26.7 +import pEpIOSToolbox
    26.8  
    26.9  public typealias ImapStoreCommand = (command: String, pantomimeDict:[AnyHashable: Any])
   26.10  
    27.1 --- a/MessageModel/MessageModel/NetworkService/Util/ConnectInfo.swift	Thu Feb 21 09:20:56 2019 +0100
    27.2 +++ b/MessageModel/MessageModel/NetworkService/Util/ConnectInfo.swift	Thu Feb 21 13:42:30 2019 +0100
    27.3 @@ -6,6 +6,8 @@
    27.4  //  Copyright © 2018 p≡p Security S.A. All rights reserved.
    27.5  //
    27.6  
    27.7 +import pEpIOSToolbox
    27.8 +
    27.9  enum NetworkAddressType: String {
   27.10      case ipv4 = "IPv4"
   27.11      case ipv6 = "IPv6"
    28.1 --- a/MessageModel/MessageModel/NetworkService/Util/Folder+Imap.swift	Thu Feb 21 09:20:56 2019 +0100
    28.2 +++ b/MessageModel/MessageModel/NetworkService/Util/Folder+Imap.swift	Thu Feb 21 13:42:30 2019 +0100
    28.3 @@ -6,6 +6,8 @@
    28.4  //  Copyright © 2018 p≡p Security S.A. All rights reserved.
    28.5  //
    28.6  
    28.7 +import pEpIOSToolbox
    28.8 +
    28.9  /// Logic based on data MessageModel should not know.
   28.10  extension Folder {
   28.11  
    29.1 --- a/MessageModel/MessageModel/NetworkService/Util/LegacyConnectInfoProvider.swift	Thu Feb 21 09:20:56 2019 +0100
    29.2 +++ b/MessageModel/MessageModel/NetworkService/Util/LegacyConnectInfoProvider.swift	Thu Feb 21 13:42:30 2019 +0100
    29.3 @@ -8,6 +8,8 @@
    29.4  
    29.5  import CoreData
    29.6  
    29.7 +import pEpIOSToolbox
    29.8 +
    29.9  /// Supports usage of deprecated EmailConnectInfo.
   29.10  extension ConnectInfo {
   29.11      @available(*, deprecated, message: "use account instead")
    30.1 --- a/MessageModel/MessageModel/NetworkService/Util/Message+IMAP.swift	Thu Feb 21 09:20:56 2019 +0100
    30.2 +++ b/MessageModel/MessageModel/NetworkService/Util/Message+IMAP.swift	Thu Feb 21 13:42:30 2019 +0100
    30.3 @@ -6,6 +6,8 @@
    30.4  //  Copyright © 2017 p≡p Security S.A. All rights reserved.
    30.5  //
    30.6  
    30.7 +import pEpIOSToolbox
    30.8 +
    30.9  extension Message {
   30.10      static let uidNeedsAppend = 0
   30.11      static let uidFakeResponsivenes = -1
    31.1 --- a/MessageModel/MessageModel/NetworkService/Util/Message+pEp.swift	Thu Feb 21 09:20:56 2019 +0100
    31.2 +++ b/MessageModel/MessageModel/NetworkService/Util/Message+pEp.swift	Thu Feb 21 13:42:30 2019 +0100
    31.3 @@ -6,6 +6,8 @@
    31.4  //  Copyright © 2016 p≡p Security S.A. All rights reserved.
    31.5  //
    31.6  
    31.7 +import pEpIOSToolbox
    31.8 +
    31.9  extension Message {
   31.10      public var isEncrypted: Bool {
   31.11          return PEPUtil.pEpRatingFromInt(self.pEpRatingInt) == PEP_rating_undefined
    32.1 --- a/MessageModel/MessageModel/NetworkService/Util/MimeTypeUtil.swift	Thu Feb 21 09:20:56 2019 +0100
    32.2 +++ b/MessageModel/MessageModel/NetworkService/Util/MimeTypeUtil.swift	Thu Feb 21 13:42:30 2019 +0100
    32.3 @@ -8,6 +8,8 @@
    32.4  
    32.5  import Foundation
    32.6  
    32.7 +import pEpIOSToolbox
    32.8 +
    32.9  open class MimeTypeUtil {
   32.10      public static let defaultMimeType = "application/octet-stream"
   32.11      public static let jpegMimeType = "image/jpeg"
    33.1 --- a/MessageModel/MessageModel/NetworkService/Util/String+Attachment.swift	Thu Feb 21 09:20:56 2019 +0100
    33.2 +++ b/MessageModel/MessageModel/NetworkService/Util/String+Attachment.swift	Thu Feb 21 13:42:30 2019 +0100
    33.3 @@ -8,6 +8,8 @@
    33.4  
    33.5  import Foundation
    33.6  
    33.7 +import pEpIOSToolbox
    33.8 +
    33.9  extension String {
   33.10      public func firstMatch(pattern: String, rangeNumber: Int = 1) -> String? {
   33.11          do {