mirror of
https://github.com/signalapp/libsignal.git
synced 2024-09-19 19:42:19 +02:00
Update backup.proto to latest version
This commit is contained in:
parent
66cd3f0133
commit
f6acd4f98d
@ -294,7 +294,7 @@ impl<M: Method + ReferencedTypes> TryFrom<proto::account_data::AccountSettings>
|
||||
storyViewReceiptsEnabled,
|
||||
hasSeenGroupStoryEducationSheet,
|
||||
hasCompletedUsernameOnboarding,
|
||||
universalExpireTimer,
|
||||
universalExpireTimerSeconds,
|
||||
preferredReactionEmoji,
|
||||
defaultChatStyle,
|
||||
customChatColors,
|
||||
@ -317,8 +317,8 @@ impl<M: Method + ReferencedTypes> TryFrom<proto::account_data::AccountSettings>
|
||||
.map(|style| style.try_into_with(&custom_chat_colors))
|
||||
.transpose()?;
|
||||
|
||||
let universal_expire_timer =
|
||||
NonZeroU32::new(universalExpireTimer).map(|d| Duration::from_millis(d.get().into()));
|
||||
let universal_expire_timer = NonZeroU32::new(universalExpireTimerSeconds)
|
||||
.map(|seconds| Duration::from_millis(1000 * u64::from(seconds.get())));
|
||||
|
||||
Ok(Self {
|
||||
phone_number_sharing: M::value(phone_number_sharing),
|
||||
@ -393,6 +393,7 @@ mod test {
|
||||
FAKE_CUSTOM_COLOR_ID.0,
|
||||
)),
|
||||
wallpaper: None,
|
||||
dimWallpaperInDarkMode: true,
|
||||
special_fields: Default::default(),
|
||||
})
|
||||
.into(),
|
||||
@ -450,6 +451,7 @@ mod test {
|
||||
default_chat_style: Some(ChatStyle {
|
||||
wallpaper: None,
|
||||
bubble_color: BubbleColor::Custom(FAKE_CUSTOM_COLOR.clone()),
|
||||
dim_wallpaper_in_dark_mode: true,
|
||||
}),
|
||||
read_receipts: false,
|
||||
sealed_sender_indicators: false,
|
||||
|
@ -17,6 +17,7 @@ use crate::proto::backup as proto;
|
||||
pub struct ChatStyle<M: ReferencedTypes> {
|
||||
pub wallpaper: Option<Wallpaper>,
|
||||
pub bubble_color: BubbleColor<M::CustomColorReference>,
|
||||
pub dim_wallpaper_in_dark_mode: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
@ -154,6 +155,7 @@ impl<C: Lookup<CustomColorId, M::CustomColorReference>, M: ReferencedTypes>
|
||||
let proto::ChatStyle {
|
||||
wallpaper,
|
||||
bubbleColor,
|
||||
dimWallpaperInDarkMode,
|
||||
special_fields: _,
|
||||
} = value;
|
||||
|
||||
@ -166,6 +168,7 @@ impl<C: Lookup<CustomColorId, M::CustomColorReference>, M: ReferencedTypes>
|
||||
Ok(Self {
|
||||
wallpaper,
|
||||
bubble_color,
|
||||
dim_wallpaper_in_dark_mode: dimWallpaperInDarkMode,
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -368,6 +371,7 @@ mod test {
|
||||
bubbleColor: Some(proto::chat_style::BubbleColor::AutoBubbleColor(
|
||||
Default::default(),
|
||||
)),
|
||||
dimWallpaperInDarkMode: true,
|
||||
special_fields: Default::default(),
|
||||
}
|
||||
}
|
||||
@ -418,6 +422,7 @@ mod test {
|
||||
enum_value: proto::chat_style::WallpaperPreset::GRADIENT_AQUA
|
||||
})),
|
||||
bubble_color: BubbleColor::Auto,
|
||||
dim_wallpaper_in_dark_mode: true,
|
||||
})
|
||||
)
|
||||
}
|
||||
|
@ -377,9 +377,9 @@ impl ValidateFrom<Vec<proto::group_invitation_revoked_update::Invitee>> for Vec<
|
||||
}
|
||||
}
|
||||
|
||||
impl ValidateFrom<u32> for Duration {
|
||||
fn validate_from(value: u32) -> Result<Self, GroupUpdateFieldError> {
|
||||
Ok(Self::from_millis(value.into()))
|
||||
impl ValidateFrom<u64> for Duration {
|
||||
fn validate_from(value: u64) -> Result<Self, GroupUpdateFieldError> {
|
||||
Ok(Self::from_millis(value))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ impl<C: Lookup<RecipientId, R>, R: Clone> TryFromWith<proto::ChatUpdateMessage,
|
||||
expiresInMs,
|
||||
special_fields: _,
|
||||
}) => UpdateMessage::ExpirationTimerChange {
|
||||
expires_in: Duration::from_millis(expiresInMs.into()),
|
||||
expires_in: Duration::from_millis(expiresInMs),
|
||||
},
|
||||
Update::ProfileChange(proto::ProfileChangeChatUpdate {
|
||||
previousName,
|
||||
|
@ -45,7 +45,8 @@
|
||||
"color": 123456
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dim_wallpaper_in_dark_mode": true
|
||||
},
|
||||
"custom_chat_colors": [
|
||||
[
|
||||
|
@ -63,7 +63,7 @@ message AccountData {
|
||||
bool linkPreviews = 4;
|
||||
bool notDiscoverableByPhoneNumber = 5;
|
||||
bool preferContactAvatars = 6;
|
||||
uint32 universalExpireTimer = 7; // 0 means no universal expire timer.
|
||||
uint32 universalExpireTimerSeconds = 7; // 0 means no universal expire timer.
|
||||
repeated string preferredReactionEmoji = 8;
|
||||
bool displayBadgesOnProfile = 9;
|
||||
bool keepMutedChatsArchived = 10;
|
||||
@ -565,7 +565,7 @@ message FilePointer {
|
||||
optional uint32 cdnNumber = 2;
|
||||
bytes key = 3;
|
||||
bytes digest = 4;
|
||||
uint32 size = 5;
|
||||
uint64 size = 5;
|
||||
// Fallback in case backup tier upload failed.
|
||||
optional string transitCdnKey = 6;
|
||||
optional uint32 transitCdnNumber = 7;
|
||||
@ -757,7 +757,7 @@ message SimpleChatUpdate {
|
||||
// For 1:1 chat updates only.
|
||||
// For group thread updates use GroupExpirationTimerUpdate.
|
||||
message ExpirationTimerChatUpdate {
|
||||
uint32 expiresInMs = 1; // 0 means the expiration timer was disabled
|
||||
uint64 expiresInMs = 1; // 0 means the expiration timer was disabled
|
||||
}
|
||||
|
||||
message ProfileChangeChatUpdate {
|
||||
@ -1023,7 +1023,7 @@ message GroupV2MigrationDroppedMembersUpdate {
|
||||
|
||||
// For 1:1 timer updates, use ExpirationTimerChatUpdate.
|
||||
message GroupExpirationTimerUpdate {
|
||||
uint32 expiresInMs = 1; // 0 means the expiration timer was disabled
|
||||
uint64 expiresInMs = 1; // 0 means the expiration timer was disabled
|
||||
optional bytes updaterAci = 2;
|
||||
}
|
||||
|
||||
@ -1035,7 +1035,7 @@ message StickerPack {
|
||||
message ChatStyle {
|
||||
message Gradient {
|
||||
uint32 angle = 1; // degrees
|
||||
repeated uint32 colors = 2;
|
||||
repeated fixed32 colors = 2;
|
||||
repeated float positions = 3; // percent from 0 to 1
|
||||
}
|
||||
|
||||
@ -1043,7 +1043,7 @@ message ChatStyle {
|
||||
uint32 id = 1;
|
||||
|
||||
oneof color {
|
||||
uint32 solid = 2;
|
||||
fixed32 solid = 2;
|
||||
Gradient gradient = 3;
|
||||
}
|
||||
}
|
||||
@ -1116,4 +1116,6 @@ message ChatStyle {
|
||||
// See AccountSettings.customChatColors
|
||||
uint32 customColorId = 5;
|
||||
}
|
||||
|
||||
bool dimWallpaperInDarkMode = 7;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 9147958cf6c8823c015b1a78915d093207b0da80
|
||||
Subproject commit 8072a8abce3415a66371256cf3e02e01af8c9235
|
Loading…
Reference in New Issue
Block a user