Skip to content
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

moderation.banInfo #77

Closed
wants to merge 1 commit into from
Closed

moderation.banInfo #77

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented May 1, 2020

This patch does some internal reorganization to the fields that listBans() returns so this is a breaking change. But with this change, you can set additional properties such as a reason for a ban message:

      cabal0.publish({
        type: 'ban/add',
        content: { key: key1, reason: 'spammer' }
      })

and then later or on a different synchronized cabal you can read that information back using banInfo():

          cabal2.moderation.banInfo(bans[0].key, function (err, info) {
            t.error(err)
            t.deepEqual(info.content, {
              key: key1,
              reason: 'spammer'
            })
            t.ok(info.timestamp)
          })

This required an upstream change in materialized-group-auth in 1.2.0.

@ghost ghost mentioned this pull request May 6, 2020
@cblgh
Copy link
Member

cblgh commented May 6, 2020

@substack is this ready to be merged? (as #80 builds on it)

@ghost
Copy link
Author

ghost commented May 6, 2020

If you merge the other one this should be included by default. It might be worth renaming this to .blockInfo() depending on how the other naming changes work. Or maybe .moreInfo() since it's the same code as .modInfo() and that could be collapsed into a single method.

@@ -109,6 +110,15 @@ module.exports = function (cabal, modKey, db) {

return readonly(out)
},

banInfo: function (core, feedSeq, cb) {
if (typeof feedSeq === 'string') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would benefit from being wrapped in a this.ready() (like isBanned below), so it waits for the indexes to catch up first.

@ghost
Copy link
Author

ghost commented May 18, 2020

handled by cabal.getMessage() in #83

@ghost ghost closed this May 18, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants