fix: dont display post tools if there are no options

v1.18.x
Baris Usakli 6 years ago
parent 667bc67f04
commit 708df46ebe

@ -138,7 +138,10 @@ module.exports = function (Topics) {
post.display_delete_tools = topicPrivileges.isAdminOrMod || (post.selfPost && topicPrivileges['posts:delete']);
post.display_moderator_tools = post.display_edit_tools || post.display_delete_tools;
post.display_move_tools = topicPrivileges.isAdminOrMod && post.index !== 0;
post.display_post_menu = topicPrivileges.isAdminOrMod || (post.selfPost && !topicData.locked) || ((loggedIn || topicData.postSharing.length) && !post.deleted);
post.display_post_menu = topicPrivileges.isAdminOrMod ||
(post.selfPost && !topicData.locked && !post.deleted) ||
(post.selfPost && post.deleted && parseInt(post.deleterUid, 10) === parseInt(topicPrivileges.uid, 10)) ||
((loggedIn || topicData.postSharing.length) && !post.deleted);
post.ip = topicPrivileges.isAdminOrMod ? post.ip : undefined;
posts.modifyPostByPrivilege(post, topicPrivileges);

Loading…
Cancel
Save