Resolve [Bug]/#24 #27

Merged
csm-kb merged 24 commits from mc/1.20.2 into mc/1.20.2 2023-12-09 20:23:10 +00:00
csm-kb commented 2023-12-08 21:15:09 +00:00 (Migrated from github.com)

Resolves #24

Reopening this using the newly-renamed fork branch version!


@Awakened-Redstone @kaydenvg
When executing the whitelist register command in Discord, we take the member's guild's getPublicRole() (which isn't returned in the list from getRoles() because it is documented as implicit):

The @everyone role; synonymous with the guild's ID.

and add it explicitly to the roles we're checking on the member.

This allows users to configure the mod using their guild's @everyone role, and have it behave as expected.

Resolves #24 Reopening this using the newly-renamed fork branch version! --- @Awakened-Redstone @kaydenvg When executing the whitelist register command in Discord, we take the member's guild's getPublicRole() (which isn't returned in the list from getRoles() because it is documented as implicit): The @everyone role; synonymous with the guild's ID. and add it explicitly to the roles we're checking on the member. This allows users to configure the mod using their guild's @everyone role, and have it behave as expected.
Awakened-Redstone (Migrated from github.com) requested changes 2023-12-08 21:43:08 +00:00
Awakened-Redstone (Migrated from github.com) commented 2023-12-08 21:40:46 +00:00
        List<Role> roles = new ArrayList(member.getRoles());

MemberImpl#getRoles returns Collections.unmodifiableList(roleList)
I was trying to avoid doing this to not risk mem leak but I think I'm being worried for nothing

Other than that, everything looks great

```suggestion List<Role> roles = new ArrayList(member.getRoles()); ``` MemberImpl#getRoles returns `Collections.unmodifiableList(roleList)` I was trying to avoid doing this to not risk mem leak but I think I'm being worried for nothing Other than that, everything looks great
csm-kb (Migrated from github.com) reviewed 2023-12-09 04:26:13 +00:00
csm-kb (Migrated from github.com) commented 2023-12-09 04:26:13 +00:00

That's what I would bet, given https://stackoverflow.com/questions/53767722/converting-immutable-to-mutable-list-java-is-there-any-alternative and the dig into it shows a literal transmutation of the underlying iterable into a new memory object

That's what I would bet, given https://stackoverflow.com/questions/53767722/converting-immutable-to-mutable-list-java-is-there-any-alternative and the dig into it shows a literal transmutation of the underlying iterable into a new memory object
Awakened-Redstone (Migrated from github.com) approved these changes 2023-12-09 04:26:40 +00:00
csm-kb (Migrated from github.com) reviewed 2023-12-09 04:26:51 +00:00
csm-kb (Migrated from github.com) commented 2023-12-09 04:26:50 +00:00

(in my rebasing I somehow lost the arraylist change, so added that back)

(in my rebasing I somehow lost the arraylist change, so added that back)
Awakened-Redstone commented 2023-12-09 04:28:15 +00:00 (Migrated from github.com)

I'll run some tests later to check for any odd behavior and errors, I'm quite busy recently but I should be able to run the tests this weekend.

I'll run some tests later to check for any odd behavior and errors, I'm quite busy recently but I should be able to run the tests this weekend.
Awakened-Redstone (Migrated from github.com) reviewed 2023-12-09 04:31:51 +00:00
Awakened-Redstone (Migrated from github.com) commented 2023-12-09 04:31:51 +00:00

That's what I would bet, given https://stackoverflow.com/questions/53767722/converting-immutable-to-mutable-list-java-is-there-any-alternative and the dig into it shows a literal transmutation of the underlying iterable into a new memory object

Yeah, that is why I had a worry on that, but the GC should take care of that, else Java would blow up

> That's what I would bet, given https://stackoverflow.com/questions/53767722/converting-immutable-to-mutable-list-java-is-there-any-alternative and the dig into it shows a literal transmutation of the underlying iterable into a new memory object Yeah, that is why I had a worry on that, but the GC should take care of that, else Java would blow up
Awakened-Redstone commented 2023-12-09 20:21:35 +00:00 (Migrated from github.com)

Mostly it looks good, there are a few things that need fixing but I can do that on a new commit
I'll also do some code cleaning

Mostly it looks good, there are a few things that need fixing but I can do that on a new commit I'll also do some code cleaning
Commenting is not possible because the repository is archived.
No description provided.