mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-07 01:09:44 +02:00
ESlint comma-dangle
This commit is contained in:
@@ -44,7 +44,7 @@ module.exports = function (Groups) {
|
||||
uploadsController.uploadGroupCover(uid, {
|
||||
name: 'groupCover',
|
||||
path: tempPath,
|
||||
type: type
|
||||
type: type,
|
||||
}, next);
|
||||
},
|
||||
function (uploadData, next) {
|
||||
@@ -58,7 +58,7 @@ module.exports = function (Groups) {
|
||||
uploadsController.uploadGroupCover(uid, {
|
||||
name: 'groupCoverThumb',
|
||||
path: tempPath,
|
||||
type: type
|
||||
type: type,
|
||||
}, next);
|
||||
},
|
||||
function (uploadData, next) {
|
||||
@@ -70,7 +70,7 @@ module.exports = function (Groups) {
|
||||
} else {
|
||||
next(null);
|
||||
}
|
||||
}
|
||||
},
|
||||
], function (err) {
|
||||
fs.unlink(tempPath, function (unlinkErr) {
|
||||
if (unlinkErr) {
|
||||
@@ -91,7 +91,7 @@ module.exports = function (Groups) {
|
||||
},
|
||||
function (image, next) {
|
||||
image.write(path, next);
|
||||
}
|
||||
},
|
||||
], function (err) {
|
||||
callback(err);
|
||||
});
|
||||
@@ -109,7 +109,7 @@ module.exports = function (Groups) {
|
||||
var buffer = new Buffer(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
|
||||
|
||||
fs.writeFile(tempPath, buffer, {
|
||||
encoding: 'base64'
|
||||
encoding: 'base64',
|
||||
}, function (err) {
|
||||
callback(err, tempPath);
|
||||
});
|
||||
|
||||
@@ -42,14 +42,14 @@ module.exports = function (Groups) {
|
||||
hidden: parseInt(data.hidden, 10) === 1 ? 1 : 0,
|
||||
system: system ? 1 : 0,
|
||||
private: isPrivate,
|
||||
disableJoinRequests: disableJoinRequests
|
||||
disableJoinRequests: disableJoinRequests,
|
||||
};
|
||||
plugins.fireHook('filter:group.create', {group: groupData, data: data}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
var tasks = [
|
||||
async.apply(db.sortedSetAdd, 'groups:createtime', groupData.createtime, groupData.name),
|
||||
async.apply(db.setObject, 'group:' + groupData.name, groupData)
|
||||
async.apply(db.setObject, 'group:' + groupData.name, groupData),
|
||||
];
|
||||
|
||||
if (data.hasOwnProperty('ownerUid')) {
|
||||
@@ -72,7 +72,7 @@ module.exports = function (Groups) {
|
||||
function (results, next) {
|
||||
plugins.fireHook('action:group.create', groupData);
|
||||
next(null, groupData);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ module.exports = function (Groups) {
|
||||
db.sortedSetRemove('group:' + group + ':members', groupName, next);
|
||||
}, next);
|
||||
});
|
||||
}
|
||||
},
|
||||
], function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
|
||||
@@ -15,7 +15,7 @@ var LRU = require('lru-cache');
|
||||
|
||||
var cache = LRU({
|
||||
max: 40000,
|
||||
maxAge: 1000 * 60 * 60
|
||||
maxAge: 1000 * 60 * 60,
|
||||
});
|
||||
|
||||
module.exports = function (Groups) {
|
||||
@@ -46,7 +46,7 @@ module.exports = function (Groups) {
|
||||
Groups.create({
|
||||
name: groupName,
|
||||
description: '',
|
||||
hidden: 1
|
||||
hidden: 1,
|
||||
}, function (err) {
|
||||
if (err && err.message !== '[[error:group-already-exists]]') {
|
||||
winston.error('[groups.join] Could not create new hidden group: ' + err.message);
|
||||
@@ -62,13 +62,13 @@ module.exports = function (Groups) {
|
||||
},
|
||||
isHidden: function (next) {
|
||||
Groups.isHidden(groupName, next);
|
||||
}
|
||||
},
|
||||
}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
var tasks = [
|
||||
async.apply(db.sortedSetAdd, 'group:' + groupName + ':members', Date.now(), uid),
|
||||
async.apply(db.incrObjectField, 'group:' + groupName, 'memberCount')
|
||||
async.apply(db.incrObjectField, 'group:' + groupName, 'memberCount'),
|
||||
];
|
||||
if (results.isAdmin) {
|
||||
tasks.push(async.apply(db.setAdd, 'group:' + groupName + ':owners', uid));
|
||||
@@ -85,10 +85,10 @@ module.exports = function (Groups) {
|
||||
function (next) {
|
||||
plugins.fireHook('action:group.join', {
|
||||
groupName: groupName,
|
||||
uid: uid
|
||||
uid: uid,
|
||||
});
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -120,12 +120,12 @@ module.exports = function (Groups) {
|
||||
bodyLong: '[[groups:request.notification_text, ' + username + ', ' + groupName + ']]',
|
||||
nid: 'group:' + groupName + ':uid:' + uid + ':request',
|
||||
path: '/groups/' + utils.slugify(groupName),
|
||||
from: uid
|
||||
from: uid,
|
||||
}, next);
|
||||
},
|
||||
owners: function (next) {
|
||||
Groups.getOwners(groupName, next);
|
||||
}
|
||||
},
|
||||
}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
@@ -133,7 +133,7 @@ module.exports = function (Groups) {
|
||||
return next();
|
||||
}
|
||||
notifications.push(results.notification, results.owners, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -142,7 +142,7 @@ module.exports = function (Groups) {
|
||||
async.waterfall([
|
||||
async.apply(db.setRemove, 'group:' + groupName + ':pending', uid),
|
||||
async.apply(db.setRemove, 'group:' + groupName + ':invited', uid),
|
||||
async.apply(Groups.join, groupName, uid)
|
||||
async.apply(Groups.join, groupName, uid),
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -150,7 +150,7 @@ module.exports = function (Groups) {
|
||||
// Note: For simplicity, this method intentially doesn't check the caller uid for ownership!
|
||||
async.parallel([
|
||||
async.apply(db.setRemove, 'group:' + groupName + ':pending', uid),
|
||||
async.apply(db.setRemove, 'group:' + groupName + ':invited', uid)
|
||||
async.apply(db.setRemove, 'group:' + groupName + ':invited', uid),
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -161,11 +161,11 @@ module.exports = function (Groups) {
|
||||
bodyShort: '[[groups:invited.notification_title, ' + groupName + ']]',
|
||||
bodyLong: '',
|
||||
nid: 'group:' + groupName + ':uid:' + uid + ':invite',
|
||||
path: '/groups/' + utils.slugify(groupName)
|
||||
path: '/groups/' + utils.slugify(groupName),
|
||||
}),
|
||||
function (notification, next) {
|
||||
notifications.push(notification, [uid], next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -182,7 +182,7 @@ module.exports = function (Groups) {
|
||||
exists: async.apply(Groups.exists, groupName),
|
||||
isMember: async.apply(Groups.isMember, uid, groupName),
|
||||
isPending: async.apply(Groups.isPending, uid, groupName),
|
||||
isInvited: async.apply(Groups.isInvited, uid, groupName)
|
||||
isInvited: async.apply(Groups.isInvited, uid, groupName),
|
||||
}, next);
|
||||
},
|
||||
function (checks, next) {
|
||||
@@ -201,10 +201,10 @@ module.exports = function (Groups) {
|
||||
function (next) {
|
||||
plugins.fireHook(hookName, {
|
||||
groupName: groupName,
|
||||
uid: uid
|
||||
uid: uid,
|
||||
});
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ module.exports = function (Groups) {
|
||||
async.parallel([
|
||||
async.apply(db.sortedSetRemove, 'group:' + groupName + ':members', uid),
|
||||
async.apply(db.setRemove, 'group:' + groupName + ':owners', uid),
|
||||
async.apply(db.decrObjectField, 'group:' + groupName, 'memberCount')
|
||||
async.apply(db.decrObjectField, 'group:' + groupName, 'memberCount'),
|
||||
], next);
|
||||
},
|
||||
function (results, next) {
|
||||
@@ -253,10 +253,10 @@ module.exports = function (Groups) {
|
||||
function (next) {
|
||||
plugins.fireHook('action:group.leave', {
|
||||
groupName: groupName,
|
||||
uid: uid
|
||||
uid: uid,
|
||||
});
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -279,10 +279,10 @@ module.exports = function (Groups) {
|
||||
},
|
||||
function (next) {
|
||||
Groups.rejectMembership(groupName, uid, next);
|
||||
}
|
||||
},
|
||||
], next);
|
||||
}, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -343,7 +343,7 @@ module.exports = function (Groups) {
|
||||
function (isMember, next) {
|
||||
cache.set(cacheKey, isMember);
|
||||
next(null, isMember);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -376,7 +376,7 @@ module.exports = function (Groups) {
|
||||
});
|
||||
|
||||
getFromCache(next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -413,7 +413,7 @@ module.exports = function (Groups) {
|
||||
});
|
||||
|
||||
getFromCache(next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -551,7 +551,7 @@ module.exports = function (Groups) {
|
||||
return next(new Error('[[error:group-needs-owner]]'));
|
||||
}
|
||||
Groups.leave(groupName, uid, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
} else {
|
||||
Groups.leave(groupName, uid, callback);
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = function (Groups) {
|
||||
function (next) {
|
||||
plugins.fireHook('action:group.grantOwnership', {uid: toUid, groupName: groupName});
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ module.exports = function (Groups) {
|
||||
function (next) {
|
||||
plugins.fireHook('action:group.rescindOwnership', {uid: toUid, groupName: groupName});
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = function (Groups) {
|
||||
}
|
||||
|
||||
Groups.sort(options.sort, groupsData, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ module.exports = function (Groups) {
|
||||
}
|
||||
}
|
||||
next(null, uids);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ module.exports = function (Groups) {
|
||||
}
|
||||
});
|
||||
next(null, results);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ module.exports = function (Groups) {
|
||||
}
|
||||
plugins.fireHook('filter:group.update', {
|
||||
groupName: groupName,
|
||||
values: values
|
||||
values: values,
|
||||
}, next);
|
||||
},
|
||||
function (result, next) {
|
||||
@@ -32,7 +32,7 @@ module.exports = function (Groups) {
|
||||
var payload = {
|
||||
description: values.description || '',
|
||||
icon: values.icon || '',
|
||||
labelColor: values.labelColor || '#000000'
|
||||
labelColor: values.labelColor || '#000000',
|
||||
};
|
||||
|
||||
if (values.hasOwnProperty('userTitle')) {
|
||||
@@ -71,16 +71,16 @@ module.exports = function (Groups) {
|
||||
}
|
||||
},
|
||||
async.apply(db.setObject, 'group:' + groupName, payload),
|
||||
async.apply(renameGroup, groupName, values.name)
|
||||
async.apply(renameGroup, groupName, values.name),
|
||||
], next);
|
||||
},
|
||||
function (result, next) {
|
||||
plugins.fireHook('action:group.update', {
|
||||
name: groupName,
|
||||
values: values
|
||||
values: values,
|
||||
});
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -118,7 +118,7 @@ module.exports = function (Groups) {
|
||||
callback = callback || function () {};
|
||||
async.parallel([
|
||||
async.apply(db.setObjectField, 'group:' + groupName, 'hidden', hidden ? 1 : 0),
|
||||
async.apply(updateVisibility, groupName, hidden)
|
||||
async.apply(updateVisibility, groupName, hidden),
|
||||
], function (err) {
|
||||
callback(err);
|
||||
});
|
||||
@@ -146,9 +146,9 @@ module.exports = function (Groups) {
|
||||
winston.verbose('[groups.update] Group is now public, automatically adding ' + uids.length + ' new members, who were pending prior.');
|
||||
async.series([
|
||||
async.apply(db.sortedSetAdd, 'group:' + groupName + ':members', scores, uids),
|
||||
async.apply(db.delete, 'group:' + groupName + ':pending')
|
||||
async.apply(db.delete, 'group:' + groupName + ':pending'),
|
||||
], next);
|
||||
}
|
||||
},
|
||||
], function (err) {
|
||||
callback(err);
|
||||
});
|
||||
@@ -218,11 +218,11 @@ module.exports = function (Groups) {
|
||||
function (next) {
|
||||
plugins.fireHook('action:group.rename', {
|
||||
old: oldName,
|
||||
new: newName
|
||||
new: newName,
|
||||
});
|
||||
|
||||
next();
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
});
|
||||
});
|
||||
@@ -244,7 +244,7 @@ module.exports = function (Groups) {
|
||||
},
|
||||
function (next) {
|
||||
db.sortedSetAdd(group, score, newName, next);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user