merges the other tip/head/default
authorbuff <andreas@pep-project.org>
Wed, 01 Aug 2018 14:51:42 +0200
changeset 5663689787cf11db
parent 5660 c58326d4a3d0
parent 5662 1307161bd499
child 5664 0d4f8fba5414
merges the other tip/head/default
     1.1 --- a/pEpForiOS/Background/PersistentImapFolder.swift	Wed Aug 01 14:40:39 2018 +0200
     1.2 +++ b/pEpForiOS/Background/PersistentImapFolder.swift	Wed Aug 01 14:51:42 2018 +0200
     1.3 @@ -246,11 +246,10 @@
     1.4                  let msn = cdMsg.imap?.messageNumber
     1.5                  cdMsg.deleteAndInformDelegate(context: self.privateMOC)
     1.6                  if let theCdFolder = cdFolder, let theMsn = msn {
     1.7 -                    let p1 = NSPredicate(
     1.8 -                        format: "parent = %@ and imap.messageNumber > %d",
     1.9 -                        theCdFolder, theMsn)
    1.10 -                    let cdMsgs = CdMessage.all(
    1.11 -                        predicate: p1, in: self.privateMOC) as? [CdMessage] ?? []
    1.12 +                    let p1 = NSPredicate(format: "parent = %@ and imap.messageNumber > %d",
    1.13 +                                         theCdFolder, theMsn)
    1.14 +                    let cdMsgs = CdMessage.all(predicate: p1,
    1.15 +                                               in: self.privateMOC) as? [CdMessage] ?? []
    1.16                      for aCdMsg in cdMsgs {
    1.17                          let oldMsn = aCdMsg.imapFields().messageNumber
    1.18                          if oldMsn > 0 {
     2.1 --- a/pEpForiOS/Background/SyncMessagesOperation.swift	Wed Aug 01 14:40:39 2018 +0200
     2.2 +++ b/pEpForiOS/Background/SyncMessagesOperation.swift	Wed Aug 01 14:51:42 2018 +0200
     2.3 @@ -102,7 +102,7 @@
     2.4  
     2.5      func syncMessages(_ sync: ImapSync) {
     2.6          do {
     2.7 -            try sync.syncMessages(firstUID: firstUID, lastUID: lastUID)
     2.8 +            try sync.syncMessages(firstUID: firstUID, lastUID: lastUID, updateExistsCount: true)
     2.9          } catch {
    2.10              addError(error)
    2.11              waitForBackgroundTasksToFinish()
     3.1 --- a/pEpForiOS/Network/ImapService.swift	Wed Aug 01 14:40:39 2018 +0200
     3.2 +++ b/pEpForiOS/Network/ImapService.swift	Wed Aug 01 14:51:42 2018 +0200
     3.3 @@ -238,8 +238,8 @@
     3.4          folder.fetchUidsForNewMails()
     3.5      }
     3.6  
     3.7 -    open func syncMessages(firstUID: UInt, lastUID: UInt) throws {
     3.8 -        let folder = try openFolder(updateExistsCount: false)
     3.9 +    open func syncMessages(firstUID: UInt, lastUID: UInt, updateExistsCount: Bool = false) throws {
    3.10 +        let folder = try openFolder(updateExistsCount: updateExistsCount)
    3.11          folder.syncExistingFirstUID(firstUID, lastUID: lastUID)
    3.12      }
    3.13