TF-2384 Handle hasMoreChange when get email changes in push notification
(cherry picked from commit 5477675671fa62a1d680e655e6a4e9f3ea09df51)
This commit is contained in:
@@ -38,6 +38,13 @@ enum ResponseInvocation<T: Codable>: Codable {
|
||||
case .string(_): return nil
|
||||
}
|
||||
}
|
||||
|
||||
var response: MethodResponse<T>? {
|
||||
switch self {
|
||||
case .methodResponse(let method): return method
|
||||
case .string(_): return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct MethodResponse<T: Codable>: Codable {
|
||||
@@ -54,7 +61,7 @@ struct MethodResponse<T: Codable>: Codable {
|
||||
}
|
||||
|
||||
extension JmapResponseObject {
|
||||
func parsing(methodName: String, methodCallId: String) -> [T]? {
|
||||
func parsing(methodName: String, methodCallId: String) -> MethodResponse<T>? {
|
||||
let invocations = methodResponses.first { (responseInvocations: [ResponseInvocation<T>]) in
|
||||
return responseInvocations.contains { (responseInvocation: ResponseInvocation<T>) in
|
||||
return validateResponseInvocation(response: responseInvocation, methodName: methodName, methodCallId: methodCallId)
|
||||
@@ -68,7 +75,7 @@ extension JmapResponseObject {
|
||||
return validateMethodResponse(response: response)
|
||||
}
|
||||
|
||||
return invocation?.listObject
|
||||
return invocation?.response
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user