diff --git a/public/src/utils.js b/public/src/utils.js index 1cde4e1360..0a62e22e0e 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -86,7 +86,7 @@ // from http://stackoverflow.com/questions/46155/validate-email-address-in-javascript isEmailValid: function(email) { var re = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/; - return re.test(email); + return re.test(email); }, isUserNameValid: function(name) { diff --git a/src/categories.js b/src/categories.js index 036fb5b490..c9c9bf02b6 100644 --- a/src/categories.js +++ b/src/categories.js @@ -12,7 +12,7 @@ var RDB = require('./redis.js'), Categories.getCategoryData(category_id, function(categoryData) { - var category_name = categoryData.name; + var category_name = categoryData.name; category_slug = categoryData.slug; RDB.smembers('cid:' + category_id + ':active_users', function(err, active_users) { @@ -160,8 +160,11 @@ var RDB = require('./redis.js'), }); }); } - + function isTopicVisible(topicData, topicInfo) { + var deleted = parseInt(topicData.deleted, 10) !== 0; + return !deleted || (deleted && topicInfo.privileges.view_deleted) || topicData.uid === current_user; + } for(var i=0; i\n' + templates['noscript/header'] + templates['noscript/category'].parse(returnData) + '\n\t' +