-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
improve user feedback when interacting with moderation #52
Conversation
src/cabal-details.js
Outdated
const promises = [this.moderation.getAdmins(), this.moderation.getMods()] | ||
// get all moderation actions issued by our current mods & admins | ||
Promise.all(promises).then(results => { | ||
const keys = results[0].concat(results[1]) | ||
keys.forEach(key => { | ||
const write = (row, enc, next) => { | ||
if (!row) return | ||
const name = this.users[key].name || key.slice(0, 8) | ||
const target = this.users[row.content.id].name || row.content.id.slice(0, 8) | ||
const action = row.type.split("/")[1] | ||
const reason = row.content.reason | ||
const role = row.content.flags[0] | ||
const text = `${name} ${action === "remove" ? "removed" : "added"} ${target} as ${role} ${reason ? "reason: " + reason : ''}` | ||
this.addStatusMessage({ text, timestamp: row.timestamp }) | ||
next() | ||
} | ||
const end = (next) => { next() } | ||
pump(this.core.moderation.listModerationBy(key), to.obj(write, end)) |
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.
i might just skip this logic fwiw; what it does is it prints out all moderation actions that occured for all yr mods/admins on first startup of cabal
sorry about the wacky indentation, was trying a new thing in vim. looks like all that was being changed in my editor was purely visual; i'll run standard before releasing |
this pr adds
/actions
- list historic actions by you or your currently applied moderators/roles
- shows the admins/mods you have applied atmchat/moderation
see Sort hidden users to bottom of user pane, prefix their names with minus sign cabal-cli#192 for how it is used cc @nikolaiwarner