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
Use deep copy for layout components when applying message data #2236
Conversation
src/main/java/net/dv8tion/jda/api/utils/messages/MessageCreateRequest.java
Outdated
Show resolved
Hide resolved
Getting some kind of fix out that addresses the components part of this problem seems like a small win that we should push forward with. @MinnDevelopment do you have any other suggestions on how to proceed on this? Seems like we could just drop files and mention that they're dropped in the copy process? |
I'm fine moving forward with it as long as we limit it to components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to handle some more cases where components are copied, such as MessageEditRequest#applyCreateData/applyData
and MessageCreateRequest#applyEditData
.
src/main/java/net/dv8tion/jda/api/interactions/components/ActionRow.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/api/utils/messages/MessageCreateRequest.java
Show resolved
Hide resolved
Co-authored-by: Florian Spieß <business@minn.dev>
…onRow.java Co-authored-by: Florian Spieß <business@minn.dev>
Pull Request Etiquette
Changes
Closes Issue: #2234
Description
This PR fixes layout components being copied by reference, which allowed modifications to carry over duplicated messages