Skip to content

Node.js based forum software built for the modern web

fix: fix display post history

Barış Soner Uşaklıdc975838153a
diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.js
index 4ff69e7fc0..44b488216e 100644
--- a/src/socket.io/posts/tools.js
+++ b/src/socket.io/posts/tools.js
@@ -27,6 +27,7 @@ module.exports = function (SocketPosts) {
canDelete: privileges.posts.canDelete(data.pid, socket.uid),
canPurge: privileges.posts.canPurge(data.pid, socket.uid),
canFlag: privileges.posts.canFlag(data.pid, socket.uid),
+ canViewHistory: privileges.posts.can('posts:history', data.pid, socket.uid),
flagged: flags.exists('post', data.pid, socket.uid), // specifically, whether THIS calling user flagged
bookmarked: posts.hasBookmarked(data.pid, socket.uid),
postSharing: social.getActivePostSharing(),
@@ -46,7 +47,7 @@ module.exports = function (SocketPosts) {
postData.display_move_tools = results.isAdmin || results.isModerator;
postData.display_change_owner_tools = results.isAdmin || results.isModerator;
postData.display_ip_ban = (results.isAdmin || results.isGlobalMod) && !postData.selfPost;
- postData.display_history = results.history;
+ postData.display_history = results.history && results.canViewHistory;
postData.flags = {
flagId: parseInt(results.posts.flagId, 10) || null,
can: results.canFlag.flag,