mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 17:26:30 +03:00
target comment from @dignifiedquire, use ArchiveState inside core
This commit is contained in:
10
src/chat.rs
10
src/chat.rs
@@ -668,11 +668,7 @@ impl Chat {
|
|||||||
id: self.id,
|
id: self.id,
|
||||||
type_: self.typ as u32,
|
type_: self.typ as u32,
|
||||||
name: self.name.clone(),
|
name: self.name.clone(),
|
||||||
archived: match archive_state {
|
archived: archive_state,
|
||||||
ArchiveState::Normal => 0,
|
|
||||||
ArchiveState::Archived => 1,
|
|
||||||
ArchiveState::Pinned => 2,
|
|
||||||
},
|
|
||||||
param: self.param.to_string(),
|
param: self.param.to_string(),
|
||||||
gossiped_timestamp: self.get_gossiped_timestamp(context),
|
gossiped_timestamp: self.get_gossiped_timestamp(context),
|
||||||
is_sending_locations: self.is_sending_locations,
|
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 {
|
pub enum ArchiveState {
|
||||||
/// Neither archived or pinned
|
/// Neither archived or pinned
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@@ -997,7 +993,7 @@ pub struct ChatInfo {
|
|||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
||||||
/// Whether the chat is archived.
|
/// Whether the chat is archived.
|
||||||
pub archived: u8,
|
pub archived: ArchiveState,
|
||||||
|
|
||||||
/// The "params" of the chat.
|
/// The "params" of the chat.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user