Skip to content

Commit

Permalink
Merge pull request #279 from abdolence/fix/event-edited-optional
Browse files Browse the repository at this point in the history
Making edited field in SlackMessageEventEdited optional
  • Loading branch information
abdolence authored Jun 6, 2024
2 parents 3238af7 + fbcf461 commit e9f580a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/models/events/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub struct SlackMessageEventEdited {
#[serde(flatten)]
pub sender: SlackMessageSender,
pub ts: SlackTs,
pub edited: SlackMessageEdited,
pub edited: Option<SlackMessageEdited>,
}

#[skip_serializing_none]
Expand Down Expand Up @@ -407,7 +407,10 @@ mod test {
assert_eq!(message.sender.user, Some("UXXXXXXXXXX".into()));
assert_eq!(message.sender.bot_id, None);
assert_eq!(message.ts, "1701735043.989889".into());
assert_eq!(message.edited.ts, "1701743154.000000".into());
assert_eq!(
message.edited.map(|edited| edited.ts),
Some("1701743154.000000".into())
);
assert_eq!(
message.content.unwrap().text,
Some("edited message".to_string())
Expand All @@ -433,7 +436,10 @@ mod test {
assert_eq!(message.sender.user, None);
assert_eq!(message.sender.bot_id, Some("BXXXXXXXXXX".into()));
assert_eq!(message.ts, "1701735043.989889".into());
assert_eq!(message.edited.ts, "1701743154.000000".into());
assert_eq!(
message.edited.map(|edited| edited.ts),
Some("1701743154.000000".into())
);
assert_eq!(
message.content.unwrap().text,
Some("edited message".to_string())
Expand Down

0 comments on commit e9f580a

Please sign in to comment.