fix: Fix JSON decoding of the User type

Refs: https://gitlab.protontech.ch/apple/shared/protoncore/-/merge_requests/2317
This commit is contained in:
Ludovico Rossi 2025-12-19 12:37:02 +00:00
commit fba5d74457
3 changed files with 4 additions and 4 deletions

View file

@ -129,7 +129,7 @@ extension UserInfo: NSCoding {
twoFA: aDecoder.decodeInteger(forKey: CoderKey.twoFA),
enableFolderColor: aDecoder.decodeInteger(forKey: CoderKey.enableFolderColor),
inheritParentFolderColor: aDecoder.decodeInteger(forKey: CoderKey.inheritParentFolderColor),
subscribed: .init(rawValue: UInt8(aDecoder.decodeInteger(forKey: CoderKey.subscribed))),
subscribed: .init(rawValue: UInt64(aDecoder.decodeInteger(forKey: CoderKey.subscribed))),
groupingMode: aDecoder.decodeInteger(forKey: CoderKey.groupingMode),
weekStart: aDecoder.decodeInteger(forKey: CoderKey.weekStart),
delaySendSeconds: aDecoder.decodeIntegerIfPresent(forKey: CoderKey.delaySendSeconds),

View file

@ -31,7 +31,7 @@ extension UserInfo {
uKeys.append(Key.init(response: key_res))
}
}
let subscribed = response["Subscribed"] as? UInt8
let subscribed = response["Subscribed"] as? UInt64
self.init(
maxSpace: response["MaxSpace"] as? Int64,

View file

@ -70,9 +70,9 @@ public struct User: Codable, Equatable, CustomDebugStringConvertible {
}
public struct Subscribed: OptionSet, Codable, Equatable {
public let rawValue: UInt8
public let rawValue: UInt64
public init(rawValue: UInt8) {
public init(rawValue: UInt64) {
self.rawValue = rawValue
}