Skip to content

Commit

Permalink
Fix deserialization of previous contacts
Browse files Browse the repository at this point in the history
This caused presage to not load contacts anymore stored from previous
versions.
  • Loading branch information
Schmiddiii committed Sep 24, 2024
1 parent f99ff83 commit ae03a35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libsignal-service/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ pub struct Attachment<R> {
pub reader: R,
}

const fn default_expire_timer_version() -> u32 {
1
}

/// Mirror of the protobuf ContactDetails message
/// but with stronger types (e.g. `ServiceAddress` instead of optional uuid and string phone numbers)
/// and some helper functions
Expand All @@ -29,6 +33,7 @@ pub struct Contact {
pub verified: Verified,
pub profile_key: Vec<u8>,
pub expire_timer: u32,
#[serde(default = "default_expire_timer_version")]
pub expire_timer_version: u32,
pub inbox_position: u32,
pub archived: bool,
Expand Down

0 comments on commit ae03a35

Please sign in to comment.