|
|
|
@ -11,7 +11,6 @@ var RDB = require('./redis.js')
|
|
|
|
|
async = require('async'),
|
|
|
|
|
feed = require('./feed.js'),
|
|
|
|
|
favourites = require('./favourites.js'),
|
|
|
|
|
clientConfig = require('../public/config.json'),
|
|
|
|
|
reds = require('reds'),
|
|
|
|
|
topicSearch = reds.createSearch('nodebbtopicsearch');
|
|
|
|
|
|
|
|
|
@ -531,7 +530,7 @@ marked.setOptions({
|
|
|
|
|
type: 'error',
|
|
|
|
|
timeout: 2000,
|
|
|
|
|
title: 'Title too short',
|
|
|
|
|
message: "Please enter a longer title. At least " + clientConfig.minimumTitleLength + " characters.",
|
|
|
|
|
message: "Please enter a longer title. At least " + config.minimumTitleLength + " characters.",
|
|
|
|
|
alert_id: 'post_error'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -548,17 +547,17 @@ marked.setOptions({
|
|
|
|
|
if (uid === 0) {
|
|
|
|
|
callback(new Error('not-logged-in'), null);
|
|
|
|
|
return;
|
|
|
|
|
} else if(!title || title.length < clientConfig.minimumTitleLength) {
|
|
|
|
|
} else if(!title || title.length < config.minimumTitleLength) {
|
|
|
|
|
callback(new Error('title-too-short'), null);
|
|
|
|
|
return;
|
|
|
|
|
} else if (!content || content.length < clientConfig.miminumPostLength) {
|
|
|
|
|
} else if (!content || content.length < config.miminumPostLength) {
|
|
|
|
|
callback(new Error('content-too-short'), null);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user.getUserField(uid, 'lastposttime', function(lastposttime) {
|
|
|
|
|
|
|
|
|
|
if(Date.now() - lastposttime < nconf.get('post_delay')) {
|
|
|
|
|
if(Date.now() - lastposttime < config.postDelay) {
|
|
|
|
|
callback(new Error('too-many-posts'), null);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|