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

nodebb-plugin-shoutbox

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodebb-plugin-shoutbox - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

public/sounds/shoutbox-cena.mp3

13

lib/commands.js

@@ -9,3 +9,8 @@ "use strict";

Commands.sockets = {
wobble: function(socket, data, callback) {
wobble: soundCommand('wobble'),
cena: soundCommand('cena')
};
function soundCommand(sound) {
return function(socket, data, callback) {
if (!socket.uid || !data) return callback(new Error('invalid-data'));

@@ -23,3 +28,3 @@

if (userSocket) {
userSocket.emit('event:shoutbox.wobble');
userSocket.emit('event:shoutbox.' + sound);
}

@@ -29,6 +34,6 @@ }

} else {
socket.emit('event:shoutbox.wobble');
socket.emit('event:shoutbox.' + sound);
}
}
};
}

@@ -35,0 +40,0 @@ for (var s in Commands.sockets) {

@@ -91,2 +91,3 @@ "use strict";

isAdmin: async.apply(NodeBB.User.isAdministrator, userData.uid),
isMod: async.apply(NodeBB.User.isGlobalModerator, userData.uid),
status: function(next) {

@@ -107,2 +108,3 @@ NodeBB.User.isOnline(userData.uid, function(err, isOnline) {

userData.isAdmin = result.isAdmin;
userData.isMod = result.isMod;

@@ -119,2 +121,3 @@ callback(null, {

isAdmin: async.apply(NodeBB.User.isAdministrator, uid),
isMod: async.apply(NodeBB.User.isGlobalModerator, uid),
fromUid: async.apply(NodeBB.db.getObjectField, 'shout:' + sid, 'fromuid')

@@ -124,3 +127,3 @@ }, function(err, result) {

if (result.isAdmin || parseInt(result.fromUid, 10) === parseInt(uid, 10)) {
if (result.isAdmin || result.isMod || parseInt(result.fromUid, 10) === parseInt(uid, 10)) {
NodeBB.db.setObjectField('shout:' + sid, 'deleted', '1', function (err, result) {

@@ -140,2 +143,3 @@ if (err) return callback(err);

isAdmin: async.apply(NodeBB.User.isAdministrator, uid),
isMod: async.apply(NodeBB.User.isGlobalModerator, uid),
fromUid: async.apply(NodeBB.db.getObjectField, 'shout:' + sid, 'fromuid')

@@ -145,3 +149,3 @@ }, function(err, result) {

if (result.isAdmin || parseInt(result.fromUid, 10) === parseInt(uid, 10)) {
if (result.isAdmin || result.isMod || parseInt(result.fromUid, 10) === parseInt(uid, 10)) {
NodeBB.db.setObjectField('shout:' + sid, 'content', msg, function(err, result) {

@@ -148,0 +152,0 @@ if (err) return callback(err);

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

sounds.push(__dirname + '/public/sounds/shoutbox-notification.mp3');
sounds.push(__dirname + '/public/sounds/shoutbox-wobblysausage.mp3');
sounds.push(__dirname + '/public/sounds/shoutbox-wobble.mp3');
sounds.push(__dirname + '/public/sounds/shoutbox-cena.mp3');
callback(null, sounds);

@@ -72,0 +73,0 @@ };

{
"name": "nodebb-plugin-shoutbox",
"version": "0.3.1",
"version": "0.3.2",
"description": "NodeBB Shoutbox Plugin",

@@ -24,8 +24,8 @@ "main": "library.js",

"dependencies": {
"async": "~0.2.9",
"string": "~1.8.0"
"async": "~1.5.2",
"string": "~3.3.1"
},
"nbbpm": {
"compatibility": "^0.9.0"
"compatibility": "^1.0.0"
}
}

@@ -175,3 +175,3 @@ /* global app, $ */

if (shout.data('uid') === app.user.uid || app.user.isAdmin) {
if (shout.data('uid') === app.user.uid || app.user.isAdmin || app.user.isGlobalMod) {
sbInstance.vars.editing = sid;

@@ -178,0 +178,0 @@

@@ -57,3 +57,3 @@ "use strict";

// Permissions
el.user.isMod = el.isOwn || app.user.isAdmin;
el.user.isMod = el.isOwn || app.user.isAdmin || app.user.isGlobalMod;

@@ -60,0 +60,0 @@ // Add shout chain information to shout

@@ -5,10 +5,2 @@ /* global utils */

(function(Shoutbox) {
var SocketMessages = {
wobble: 'plugins.shoutbox.wobble'
};
var SocketEvents = {
onWobble: 'event:shoutbox.wobble'
};
var ArgumentHandlers = {

@@ -45,11 +37,27 @@ username: function(argument) {

},
wobble: {
thisagain: {
info: {
usage: '/wobble <username>',
description: 'WOBULLY SASUGE'
usage: '/thisagain',
description: 'Remind the n00bs of the obvious'
},
handlers: {
action: function(argument, sendShout) {
sendShout('This again... Clear your cache and refresh.');
}
}
},
wobble: soundCommand('wobble', 'WOBULLY SASUGE'),
cena: soundCommand('cena', 'AND HIS NAME IS')
};
function soundCommand(sound, description) {
return {
info: {
usage: '/' + sound + ' <username>',
description: description
},
register: function(sbInstance) {
sbInstance.sockets.registerMessage('wobble', SocketMessages.wobble);
sbInstance.sockets.registerEvent(SocketEvents.onWobble, function() {
sbInstance.utils.playSound('wobblysausage');
sbInstance.sockets.registerMessage(sound, 'plugins.shoutbox.' + sound);
sbInstance.sockets.registerEvent('event:shoutbox.' + sound, function() {
sbInstance.utils.playSound(sound);
});

@@ -59,3 +67,3 @@ },

action: function(argument, sendShout, sbInstance) {
sbInstance.sockets.wobble({
sbInstance.sockets[sound]({
victim: ArgumentHandlers.username(argument)

@@ -65,15 +73,4 @@ });

}
},
thisagain: {
info: {
usage: '/thisagain',
description: 'Remind the n00bs of the obvious'
},
handlers: {
action: function(argument, sendShout) {
sendShout('This again... Clear your cache and refresh.');
}
}
}
};
}

@@ -80,0 +77,0 @@ for (var c in DefaultCommands) {

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