Skip to content

Commit

Permalink
Add missing #[serde(default)] when using serde_optional_base64 (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon authored Jan 10, 2022
1 parent 49651bb commit bb76ca5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libsignal-service/src/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ pub struct EnvelopeEntity {
pub source: Option<String>,
pub source_uuid: Option<String>,
pub source_device: u32,
#[serde(with = "serde_optional_base64")]
#[serde(default, with = "serde_optional_base64")]
pub message: Option<Vec<u8>>,
#[serde(with = "serde_optional_base64")]
#[serde(default, with = "serde_optional_base64")]
pub content: Option<Vec<u8>>,
pub server_timestamp: u64,
pub guid: String,
Expand Down
2 changes: 1 addition & 1 deletion libsignal-service/src/provisioning/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct ConfirmCodeMessage {
pub video: bool,
pub fetches_messages: bool,
pub pin: Option<String>,
#[serde(with = "serde_optional_base64")]
#[serde(default, with = "serde_optional_base64")]
pub unidentified_access_key: Option<Vec<u8>>,
pub unrestricted_unidentified_access: bool,
pub discoverable_by_phone_number: bool,
Expand Down
10 changes: 5 additions & 5 deletions libsignal-service/src/push_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ 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<Vec<u8>>,
pub registration_id: u32,
pub voice: bool,
pub video: bool,
pub fetches_messages: bool,
pub pin: Option<String>,
pub registration_lock: Option<String>,
#[serde(with = "serde_optional_base64")]
#[serde(default, with = "serde_optional_base64")]
pub unidentified_access_key: Option<Vec<u8>>,
pub unrestricted_unidentified_access: bool,
pub discoverable_by_phone_number: bool,
Expand Down Expand Up @@ -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<Vec<u8>>,
#[serde(with = "serde_optional_base64")]
#[serde(default, with = "serde_optional_base64")]
pub about: Option<Vec<u8>>,
#[serde(with = "serde_optional_base64")]
#[serde(default, with = "serde_optional_base64")]
pub about_emoji: Option<Vec<u8>>,
}

Expand Down

0 comments on commit bb76ca5

Please sign in to comment.