From bb76ca58fbb50e5064328117cca5b8b1c72db919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Mon, 10 Jan 2022 23:59:47 +0100 Subject: [PATCH] Add missing #[serde(default)] when using serde_optional_base64 (#120) --- libsignal-service/src/envelope.rs | 4 ++-- libsignal-service/src/provisioning/manager.rs | 2 +- libsignal-service/src/push_service.rs | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libsignal-service/src/envelope.rs b/libsignal-service/src/envelope.rs index 059568d17..fd3f59831 100644 --- a/libsignal-service/src/envelope.rs +++ b/libsignal-service/src/envelope.rs @@ -186,9 +186,9 @@ pub struct EnvelopeEntity { pub source: Option, pub source_uuid: Option, pub source_device: u32, - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub message: Option>, - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub content: Option>, pub server_timestamp: u64, pub guid: String, diff --git a/libsignal-service/src/provisioning/manager.rs b/libsignal-service/src/provisioning/manager.rs index 5fd001c2c..95ab29019 100644 --- a/libsignal-service/src/provisioning/manager.rs +++ b/libsignal-service/src/provisioning/manager.rs @@ -31,7 +31,7 @@ pub struct ConfirmCodeMessage { pub video: bool, pub fetches_messages: bool, pub pin: Option, - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub unidentified_access_key: Option>, pub unrestricted_unidentified_access: bool, pub discoverable_by_phone_number: bool, diff --git a/libsignal-service/src/push_service.rs b/libsignal-service/src/push_service.rs index b35b784a8..6d9c2de0c 100644 --- a/libsignal-service/src/push_service.rs +++ b/libsignal-service/src/push_service.rs @@ -84,7 +84,7 @@ pub struct DeviceInfo { #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct AccountAttributes { - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub signaling_key: Option>, pub registration_id: u32, pub voice: bool, @@ -92,7 +92,7 @@ pub struct AccountAttributes { pub fetches_messages: bool, pub pin: Option, pub registration_lock: Option, - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub unidentified_access_key: Option>, pub unrestricted_unidentified_access: bool, pub discoverable_by_phone_number: bool, @@ -245,11 +245,11 @@ pub struct StaleDevices { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SignalServiceProfile { - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub name: Option>, - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub about: Option>, - #[serde(with = "serde_optional_base64")] + #[serde(default, with = "serde_optional_base64")] pub about_emoji: Option>, }