Skip to content

Commit

Permalink
Allow OC controlled bots to send crypto messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Jul 26, 2024
1 parent fea41c1 commit 70a95e5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion backend/libraries/chat_events/src/message_content_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,18 @@ impl From<MessageContentInitial> for MessageContentInternal {
MessageContentInitial::MessageReminderCreated(r) => MessageContentInternal::MessageReminderCreated(r.into()),
MessageContentInitial::MessageReminder(r) => MessageContentInternal::MessageReminder(r.into()),
MessageContentInitial::Custom(c) => MessageContentInternal::Custom(c.into()),
MessageContentInitial::Crypto(_) | MessageContentInitial::P2PSwap(_) | MessageContentInitial::Prize(_) => {
MessageContentInitial::Crypto(c) => {
if let CryptoTransaction::Completed(transfer) = c.transfer {
MessageContentInternal::Crypto(CryptoContentInternal {
recipient: c.recipient,
transfer,
caption: c.caption,
})
} else {
panic!("Crypto transfer must be completed")
}
}
MessageContentInitial::P2PSwap(_) | MessageContentInitial::Prize(_) => {
unreachable!()
}
}
Expand Down

0 comments on commit 70a95e5

Please sign in to comment.