New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nodebb-plugin-poll

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodebb-plugin-poll - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

42

lib/hooks.js

@@ -17,10 +17,12 @@ var NodeBB = require('./nodebb'),

Hooks.filter.postSave = function(postData, callback) {
// Is this the first post?
NodeBB.Topics.getPostCount(postData.tid, function(err, postCount) {
if (parseInt(postCount, 10) !== 0) {
return callback(null, postData);
}
if (Serializer.hasMarkup(postData.content)) {
// Is this the first post?
NodeBB.Topics.getPostCount(postData.tid, function(err, postCount) {
if (parseInt(postCount, 10) !== 0) {
return callback(null, postData);
}
savePoll(postData, callback);
});
savePoll(postData, callback);
});
}
};

@@ -38,18 +40,22 @@

canCreate(result.cid, obj.post.editor, function(err, canCreate) {
if (err) {
return callback(err, obj);
}
savePoll(obj.post, function(err, postData) {
if (err || !postData.pollId) {
if (Serializer.hasMarkup(obj.post.content)) {
canCreate(result.cid, obj.post.editor, function (err, canCreate) {
if (err) {
return callback(err, obj);
}
// NodeBB only updates the edited, editor and content fields, so we add the pollId field manually.
NodeBB.Posts.setPostField(obj.post.pid, 'pollId', postData.pollId, function() {
callback(null, obj);
savePoll(obj.post, function (err, postData) {
if (err || !postData.pollId) {
return callback(err, obj);
}
// NodeBB only updates the edited, editor and content fields, so we add the pollId field manually.
NodeBB.Posts.setPostField(obj.post.pid, 'pollId', postData.pollId, function () {
callback(null, obj);
});
});
});
});
} else {
return callback(null, obj);
}
});

@@ -56,0 +62,0 @@ };

@@ -5,3 +5,4 @@ "use strict";

NodeBB = require('./nodebb'),
async = require('async');
async = require('async'),
winston = require.main.require('winston');

@@ -20,3 +21,3 @@ (function(Upgrade) {

async.each(cids, function(cid, next) {
console.log(cid);
winston.verbose('[plugin/poll] Upgrading cid ' + cid);
NodeBB.Privileges.categories.give(['poll:create'], cid, 'registered-users', next);

@@ -23,0 +24,0 @@ }, next);

{
"name": "nodebb-plugin-poll",
"version": "0.2.6",
"version": "0.2.7",
"description": "NodeBB Poll Plugin",

@@ -5,0 +5,0 @@ "main": "library.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc