-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement channel archiving #103
Conversation
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.
Nicely done @cblgh! This looks really good :)
views/channel-archiving.js
Outdated
ops.push({ | ||
type: 'put', | ||
key: `archive!${channel}!${key}`, | ||
value: `${reason}` |
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.
For future development, it might be easier to store the sequence number here instead of duplicating the reason
field, and then pull up that msg when answering a query. That way, if we want to add any additional data to archiving ops in the future, they too won't need to be duplicated in index storage.
EDIT: Realized that the value isn't being used right now anyways. Maybe let's just write the seq# for now (so it's recorded going forward) and we can always add logic to grab the reason etc in the future.
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.
fixed this! i saved the key@seq
cause i figure that would save a concatenation step during lookup, lmk if that's silly and i'll just save the seq~
the second index keeps track of explicitly **unarchived** channels. rationale: the local user's unarchived channels should take precedence in the local view over any archiving decisions made by other moderators. this second index would not be needed if we could query the moderation view at indexing time, alas that is not meant to be (atm)
published as cabal-core@13.2.0 💖 |
This PR implements support for archiving of channels, see more background info in cabal-club/cabal-client#68 and cabal-club/cabal-client#16.
Archiving a channel is intended to hide the channel from channel browsers, and support for this will be added in cabal-client once this is finished & after this is merged. Only moderators or admins are allowed to archive channels—the local user is always allowed to archive channels, as they are always regarded as an admin in our subjective moderation system.