From 60493d30f68ce7b58621cad24a62b72584a71168 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Wed, 12 Feb 2020 20:05:57 +0100 Subject: [PATCH] target comment from @dignifiedquire, use ArchiveState inside core --- src/chat.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 1e54893b9..9e7cb847f 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -668,11 +668,7 @@ impl Chat { id: self.id, type_: self.typ as u32, name: self.name.clone(), - archived: match archive_state { - ArchiveState::Normal => 0, - ArchiveState::Archived => 1, - ArchiveState::Pinned => 2, - }, + archived: archive_state, param: self.param.to_string(), gossiped_timestamp: self.get_gossiped_timestamp(context), is_sending_locations: self.is_sending_locations, @@ -939,7 +935,7 @@ impl Chat { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)] pub enum ArchiveState { /// Neither archived or pinned Normal = 0, @@ -997,7 +993,7 @@ pub struct ChatInfo { pub name: String, /// Whether the chat is archived. - pub archived: u8, + pub archived: ArchiveState, /// The "params" of the chat. ///