IOS-663 adds som docu IOS-663
authorbuff <andreas@pep-project.org>
Wed, 16 May 2018 15:04:27 +0200
branchIOS-663
changeset 4707c02fdcbd4f05
parent 4706 df31d9ce78ad
child 4708 ebe8da58422d
IOS-663 adds som docu
pEpForiOS/Models/Message+IMAP.swift
     1.1 --- a/pEpForiOS/Models/Message+IMAP.swift	Wed May 16 15:03:43 2018 +0200
     1.2 +++ b/pEpForiOS/Models/Message+IMAP.swift	Wed May 16 15:04:27 2018 +0200
     1.3 @@ -9,7 +9,7 @@
     1.4  import MessageModel
     1.5  
     1.6  extension Message {
     1.7 -
     1.8 +    
     1.9      /// Sets flag "deleted".
    1.10      /// Use this method if you do not want the message to be moved to trash folder.
    1.11      func imapMarkDeleted() {
    1.12 @@ -17,7 +17,7 @@
    1.13          theFlags.deleted = true
    1.14          self.save()
    1.15      }
    1.16 -
    1.17 +    
    1.18      /// Triggers trashing of the message, taking everithing in account (provider specific constrains and such).
    1.19      /// Always use this method to handle "user has choosen to delete an e-mail".
    1.20      func imapDelete() {
    1.21 @@ -26,16 +26,21 @@
    1.22                                       errorString: "We should have a trash folder at this point")
    1.23              return
    1.24          }
    1.25 -
    1.26 +        
    1.27          if parent.shouldUidMoveDeletedMessagesToTrash {
    1.28              move(to: trashFolder)
    1.29          } else {
    1.30              imapMarkDeleted()
    1.31          }
    1.32      }
    1.33 -
    1.34 +    
    1.35      /// Marks the message for moving to the given folder.
    1.36      ///
    1.37 +    /// Does not actually move the message but set it's target folder.
    1.38 +    /// The Backgound layer has to take care of the actual move.
    1.39 +    /// 
    1.40 +    /// Returns immediately in case the message is in the target folder already.
    1.41 +    ///
    1.42      /// - Parameter targetFolder: folder to move the message to
    1.43      func move(to targetFolder:Folder) {
    1.44          if parent == targetFolder {