Skip to content

Commit

Permalink
Only consider text of message content for equality comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
andymandias committed Oct 30, 2024
1 parent c7d175f commit d98a7c1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion data/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ fn parse_user_and_channel_fragments(text: &str, channel_users: &[User]) -> Vec<F
})
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[derive(Debug, Clone, Eq, Hash, Serialize, Deserialize)]
pub enum Content {
Plain(String),
Fragments(Vec<Fragment>),
Expand All @@ -596,6 +596,12 @@ impl Content {
}
}

impl PartialEq for Content {
fn eq(&self, other: &Self) -> bool {
self.text() == other.text()
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Fragment {
Text(String),
Expand Down

0 comments on commit d98a7c1

Please sign in to comment.