Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow OC controlled bots to send crypto transfer messages #6117

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/canisters/community/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Bypass gates if user is invited ([#6110](https://github.com/open-chat-labs/open-chat/pull/6110))
- Return `is_invited` when previewing community/channel ([#6113](https://github.com/open-chat-labs/open-chat/pull/6113))
- Use `UserType` rather than `is_bot` and `is_oc_controlled_bot` ([#6116](https://github.com/open-chat-labs/open-chat/pull/6116))
- Allow OC controlled bots to send crypto transfer messages ([#6117](https://github.com/open-chat-labs/open-chat/pull/6117))

### Fixed

Expand Down
1 change: 1 addition & 0 deletions backend/canisters/group/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Bypass gates if user is invited ([#6110](https://github.com/open-chat-labs/open-chat/pull/6110))
- Return `is_invited` when previewing a group ([#6113](https://github.com/open-chat-labs/open-chat/pull/6113))
- Use `UserType` rather than `is_bot` and `is_oc_controlled_bot` ([#6116](https://github.com/open-chat-labs/open-chat/pull/6116))
- Allow OC controlled bots to send crypto transfer messages ([#6117](https://github.com/open-chat-labs/open-chat/pull/6117))

### Fixed

Expand Down
1 change: 1 addition & 0 deletions backend/canisters/user/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Store CHIT balances per month ([#6087](https://github.com/open-chat-labs/open-chat/pull/6087))
- Hack to include all built up CHIT in the July airdrop ([#6104](https://github.com/open-chat-labs/open-chat/pull/6104))
- Use `UserType` rather than `is_bot` and `is_oc_controlled_bot` ([#6116](https://github.com/open-chat-labs/open-chat/pull/6116))
- Allow OC controlled bots to send crypto transfer messages ([#6117](https://github.com/open-chat-labs/open-chat/pull/6117))

## [[2.0.1243](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1243-user)] - 2024-07-17

Expand Down
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
Loading