TF-2871 Block notification on folders Sent, Outbox, Drafts, Spam and Trash
This commit is contained in:
@@ -68,6 +68,11 @@ class JmapClient {
|
||||
accountId: String,
|
||||
onComplete: @escaping ([Email], [Error]) -> Void) {
|
||||
guard hasMoreChanges, let sinceState = currentSinceState else {
|
||||
if !self.totalListEmails.isEmpty {
|
||||
let sortedListEmails = self.sortListEmails(currentListEmails: self.totalListEmails)
|
||||
self.totalListEmails = sortedListEmails
|
||||
}
|
||||
|
||||
return onComplete(self.totalListEmails, self.listErrors)
|
||||
}
|
||||
|
||||
@@ -85,8 +90,7 @@ class JmapClient {
|
||||
if let response = data.parsing(methodName: JmapConstants.EMAIL_GET_METHOD_NAME, methodCallId: "c1") {
|
||||
if let listEmail = response.list,
|
||||
!listEmail.isEmpty {
|
||||
let sortedListEmails = self.sortListEmails(currentListEmails: listEmail)
|
||||
self.totalListEmails.append(contentsOf: sortedListEmails)
|
||||
self.totalListEmails.append(contentsOf: listEmail)
|
||||
}
|
||||
self.hasMoreChanges = response.hasMoreChanges ?? false
|
||||
self.currentSinceState = response.newState
|
||||
@@ -97,6 +101,11 @@ class JmapClient {
|
||||
self.hasMoreChanges = false
|
||||
self.currentSinceState = nil
|
||||
|
||||
if !self.totalListEmails.isEmpty {
|
||||
let sortedListEmails = self.sortListEmails(currentListEmails: self.totalListEmails)
|
||||
self.totalListEmails = sortedListEmails
|
||||
}
|
||||
|
||||
onComplete(self.totalListEmails, self.listErrors)
|
||||
}
|
||||
},
|
||||
@@ -105,6 +114,11 @@ class JmapClient {
|
||||
self.hasMoreChanges = false
|
||||
self.currentSinceState = nil
|
||||
|
||||
if !self.totalListEmails.isEmpty {
|
||||
let sortedListEmails = self.sortListEmails(currentListEmails: self.totalListEmails)
|
||||
self.totalListEmails = sortedListEmails
|
||||
}
|
||||
|
||||
onComplete(self.totalListEmails, self.listErrors)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ struct Email: Codable {
|
||||
let preview: String?
|
||||
let from: [EmailAddress]?
|
||||
let receivedAt: String?
|
||||
let mailboxIds: [String: Bool]?
|
||||
|
||||
func getSenderName() -> String? {
|
||||
if (from == nil || from?.isEmpty == true) {
|
||||
|
||||
@@ -14,7 +14,8 @@ class JmapConstants {
|
||||
"subject",
|
||||
"preview",
|
||||
"from",
|
||||
"receivedAt"
|
||||
"receivedAt",
|
||||
"mailboxIds"
|
||||
]
|
||||
|
||||
static let EMAIL_ID = "email_id"
|
||||
|
||||
Reference in New Issue
Block a user