v1.18.x
Barış Soner Uşaklı 7 years ago
parent b2d5551960
commit 908b77fe28

@ -75,9 +75,9 @@
"nodebb-plugin-spam-be-gone": "0.5.4", "nodebb-plugin-spam-be-gone": "0.5.4",
"nodebb-rewards-essentials": "0.0.11", "nodebb-rewards-essentials": "0.0.11",
"nodebb-theme-lavender": "5.0.4", "nodebb-theme-lavender": "5.0.4",
"nodebb-theme-persona": "9.0.13", "nodebb-theme-persona": "9.0.14",
"nodebb-theme-slick": "1.2.3", "nodebb-theme-slick": "1.2.4",
"nodebb-theme-vanilla": "10.0.10", "nodebb-theme-vanilla": "10.0.11",
"nodebb-widget-essentials": "4.0.4", "nodebb-widget-essentials": "4.0.4",
"nodemailer": "^4.6.5", "nodemailer": "^4.6.5",
"passport": "^0.4.0", "passport": "^0.4.0",

@ -55,20 +55,22 @@ module.exports = function (SocketPosts) {
}, next); }, next);
}, },
function (results, next) { function (results, next) {
results.posts.tools = results.tools.tools; var posts = results.posts;
results.posts.deleted = parseInt(results.posts.deleted, 10) === 1; posts.tools = results.tools.tools;
results.posts.bookmarked = results.bookmarked; posts.deleted = parseInt(posts.deleted, 10) === 1;
results.posts.selfPost = socket.uid && socket.uid === parseInt(results.posts.uid, 10); posts.bookmarked = results.bookmarked;
results.posts.display_edit_tools = results.canEdit.flag; posts.selfPost = socket.uid && socket.uid === parseInt(posts.uid, 10);
results.posts.display_delete_tools = results.canDelete.flag; posts.display_edit_tools = results.canEdit.flag;
results.posts.display_flag_tools = socket.uid && !results.posts.selfPost && results.canFlag.flag; posts.display_delete_tools = results.canDelete.flag;
results.posts.display_moderator_tools = results.posts.display_edit_tools || results.posts.display_delete_tools; posts.display_flag_tools = socket.uid && !posts.selfPost && results.canFlag.flag;
results.posts.display_move_tools = results.isAdmin || results.isModerator; posts.display_moderator_tools = posts.display_edit_tools || posts.display_delete_tools;
results.posts.display_ip_ban = (results.isAdmin || results.isGlobalMod) && !results.posts.selfPost; posts.display_move_tools = results.isAdmin || results.isModerator;
results.posts.display_history = results.history; posts.display_ip_ban = (results.isAdmin || results.isGlobalMod) && !posts.selfPost;
posts.display_history = results.history;
posts.toolsVisible = posts.tools.length || posts.display_moderator_tools;
if (!results.isAdmin && !results.isGlobalMod && !results.isModerator) { if (!results.isAdmin && !results.isGlobalMod && !results.isModerator) {
results.posts.ip = undefined; posts.ip = undefined;
} }
next(null, results); next(null, results);
}, },

Loading…
Cancel
Save