Skip to content

Commit

Permalink
Exclude empty message flags
Browse files Browse the repository at this point in the history
  • Loading branch information
novacrazy committed Nov 16, 2024
1 parent b399e51 commit 87fdcfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/models/message.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;

bitflags::bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct MessageFlags: i32 {
/// This message has been deleted
const DELETED = 1 << 0;
Expand Down Expand Up @@ -75,6 +75,7 @@ pub struct Message {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub content: Option<SmolStr>,

#[serde(default, skip_serializing_if = "MessageFlags::is_empty")]
pub flags: MessageFlags,

#[serde(default, skip_serializing_if = "ThinVec::is_empty")]
Expand Down

0 comments on commit 87fdcfa

Please sign in to comment.