I saw #368 and decided to take a bit of a closer look at it. I set up a server like this, which I think emulates the situation described in the issue close enough:
private-category (visible to admin only)
role1 (visible to role1 only)
admin (admin only)
public-category (visible to all)
role1 (visible to role1 only)
admin (admin only)
empty-public-category (visible to all)
(no channels added here)
Previously, this resulted in the following GuildTree:
public-category
role1
With this fix, the GuildTree looks like this for the role1 member:
private-category
role1
public-category
role1
This matches how the web client displays them, too.
The issue was that categories were not being drawn if the user did not have view channel permissions for them. However, a category can be hidden and still have user-visible channels, which should be drawn in the guild tree.
With this fix, the createChannelNodes() function now has three steps as follows:
Draw all top-level, non-category channels
Draw categories that have at least one visible channel (regardless of the categories' own visibility)
Draw channels inside (visible) categories if they are visible to the user
Hi!
I saw #368 and decided to take a bit of a closer look at it. I set up a server like this, which I think emulates the situation described in the issue close enough:
Previously, this resulted in the following GuildTree:
With this fix, the GuildTree looks like this for the role1 member:
This matches how the web client displays them, too.
The issue was that categories were not being drawn if the user did not have view channel permissions for them. However, a category can be hidden and still have user-visible channels, which should be drawn in the guild tree.
With this fix, the
createChannelNodes()
function now has three steps as follows:Cheers!