@@ -331,11 +331,13 @@ impl CloudKitEncryptedValue for MessageFlags {
331331 }
332332}
333333
334+ // a generic "apple has no schema" type. They really don't.
334335#[ derive( Serialize , Deserialize , Debug , Clone ) ]
335336#[ serde( untagged) ]
336337pub enum NumOrString {
337338 Num ( u32 ) ,
338339 String ( String ) ,
340+ Bool ( bool ) ,
339341}
340342impl Default for NumOrString {
341343 fn default ( ) -> Self {
@@ -401,7 +403,7 @@ impl Into<Option<MMCSAttachmentMeta>> for &Attachment {
401403#[ derive( Serialize , Deserialize , Debug , Clone , Default ) ]
402404pub struct AttachmentMetaExtra {
403405 #[ serde( rename = "pgens" ) ]
404- pub preview_generation_state : Option < i32 > , // set to 1
406+ pub preview_generation_state : Option < NumOrString > , // set to 1
405407}
406408
407409#[ derive( Serialize , Deserialize , Debug , Clone , Default ) ]
@@ -411,8 +413,9 @@ pub struct AttachmentMeta {
411413 // yes, these dates can be negative
412414 #[ serde( rename = "sdt" ) ]
413415 pub start_date : i64 ,
416+ // yes, this can be negative, i think apple is trolling...
414417 #[ serde( rename = "tb" ) ]
415- pub total_bytes : u64 ,
418+ pub total_bytes : i64 ,
416419 #[ serde( rename = "st" ) ]
417420 pub transfer_state : i32 ,
418421 #[ serde( rename = "is" ) ]
@@ -430,7 +433,7 @@ pub struct AttachmentMeta {
430433 #[ serde( rename = "ig" ) ]
431434 pub is_outgoing : bool ,
432435 #[ serde( rename = "tn" ) ]
433- pub transfer_name : String ,
436+ pub transfer_name : Option < String > ,
434437 #[ serde( rename = "vers" ) ]
435438 pub version : i32 , // set to 1
436439 #[ serde( rename = "t" ) ]
0 commit comments