From 70a95e5419a1eec929b80bd999b3f418ca5f8866 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Fri, 26 Jul 2024 10:25:22 +0100 Subject: [PATCH] Allow OC controlled bots to send crypto messages --- .../chat_events/src/message_content_internal.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/libraries/chat_events/src/message_content_internal.rs b/backend/libraries/chat_events/src/message_content_internal.rs index 20062855c0..497e849adb 100644 --- a/backend/libraries/chat_events/src/message_content_internal.rs +++ b/backend/libraries/chat_events/src/message_content_internal.rs @@ -1111,7 +1111,18 @@ impl From 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!() } }