IOS-358 initial loading of messages
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 20 Dec 2016 08:31:51 +0100
changeset 1349abfa065128fa
parent 1348 47fb980d20d4
child 1350 7a6d0a04448a
IOS-358 initial loading of messages
pEpForiOS/UI/EmailDisplay/EmailListViewController.swift
     1.1 --- a/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Mon Dec 19 17:00:48 2016 +0100
     1.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailListViewController.swift	Tue Dec 20 08:31:51 2016 +0100
     1.3 @@ -369,9 +369,15 @@
     1.4  
     1.5  extension EmailListViewController: MessageFolderDelegate {
     1.6      func didChange(messageFolder: MessageFolder) {
     1.7 -        if let msg = messageFolder as? Message {
     1.8 -            if msg.isOriginal {
     1.9 -                // new message, add it
    1.10 +        if let folder = config?.folder,
    1.11 +            let message = messageFolder as? Message,
    1.12 +            folder.contains(message: message) {
    1.13 +            if let msg = messageFolder as? Message {
    1.14 +                if msg.isOriginal {
    1.15 +                    GCD.onMain {
    1.16 +                        self.tableView.reloadData()
    1.17 +                    }
    1.18 +                }
    1.19              }
    1.20          }
    1.21      }