Repository navigation
feat: make channel lists follow role preview, add preview helpers - #208
Closed
GalaxyAkiii wants to merge 1 commit into
Closed
GalaxyAkiii wants to merge 1 commit into
GalaxyAkiii wants to merge 1 commit into
Conversation
Signed-off-by: Aki <aki@akiworks.xyz>
11 tasks done
Member
|
This library is no longer backing for-web. If your change is needed on for-web, please make the change in for-web. We'll be converting this library to a bot-only library with time. If your pr will still help with that, please reopen it with that in mind. Role preview code should probably be moved into for-web, as I don't see much of a use for it in a bot library. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #202. Moves more of the role preview into
stoat.js, so clients using the normal server and channel getters respect the preview without checking for it themselves. Also fixes previewing on currentmain, which #206 broke.Changes
Server:channelsonly lists channels the previewed roles can see. Nothing changes when not previewing.channels,defaultChannel,unreadandmentionsgo back to their pre-feat: add role preview to permission calculation #202 versions.readOnly, true while changes to the server are blocked (currently only while previewing).hasOwnerPrivileges, owner status that a preview suspends.canPreviewRole(roleId?), whether we can preview a role (or Everyone), judged by our real roles rather than the active preview. This replaces a rank check that was duplicated in two places in for-web.Channel:isVisible, whether we can see the channel, taking any preview into account.calculatePermission:return 0nwhen there's no user. The preview stand-in member has no user, so every permission came out as 0 while previewing. It now only returns early when no member was passed in.How was this PR tested?
viewAs.test.ts) cover the filtered channel list and the new helpers, and catch the feat: add dispose method to the client #206 regression if the calculator fix is reverted.Checklist:
Please declare, if any, LLM usage involved in creating this PR
None