Update notification service

This commit is contained in:
Ali
2021-09-13 20:40:09 +04:00
parent e4d277daf9
commit 0553a14eb3
50 changed files with 600 additions and 796 deletions

View File

@@ -33,6 +33,13 @@ final public class AdaptedPostboxDecoder {
}
func decode<T>(_ type: T.Type, from data: Data, contentType: ContentType) throws -> T where T : Decodable {
if type == AdaptedPostboxDecoder.RawObjectData.self {
if case .object = contentType {
return AdaptedPostboxDecoder.RawObjectData(data: data, typeHash: 0) as! T
} else {
preconditionFailure()
}
}
let decoder = _AdaptedPostboxDecoder(data: data, contentType: contentType)
return try T(from: decoder)
}