mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	feat: add topicOwnerPost #8778
This commit is contained in:
		@@ -47,11 +47,16 @@ define('forum/topic/posts', [
 | 
			
		||||
	Posts.modifyPostsByPrivileges = function (posts) {
 | 
			
		||||
		posts.forEach(function (post) {
 | 
			
		||||
			post.selfPost = !!app.user.uid && parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
 | 
			
		||||
			post.topicOwnerPost = parseInt(post.uid, 10) === parseInt(ajaxify.data.uid, 10);
 | 
			
		||||
 | 
			
		||||
			post.display_edit_tools = (ajaxify.data.privileges['posts:edit'] && post.selfPost) || ajaxify.data.privileges.isAdminOrMod;
 | 
			
		||||
			post.display_delete_tools = (ajaxify.data.privileges['posts:delete'] && post.selfPost) || ajaxify.data.privileges.isAdminOrMod;
 | 
			
		||||
			post.display_moderator_tools = post.display_edit_tools || post.display_delete_tools;
 | 
			
		||||
			post.display_move_tools = ajaxify.data.privileges.isAdminOrMod;
 | 
			
		||||
			post.display_post_menu = ajaxify.data.privileges.isAdminOrMod || (post.selfPost && !ajaxify.data.locked) || ((app.user.uid || ajaxify.data.postSharing.length) && !post.deleted);
 | 
			
		||||
			post.display_post_menu = ajaxify.data.privileges.isAdminOrMod ||
 | 
			
		||||
				(post.selfPost && !ajaxify.data.locked && !post.deleted) ||
 | 
			
		||||
				(post.selfPost && post.deleted && parseInt(post.deleterUid, 10) === parseInt(app.user.uid, 10)) ||
 | 
			
		||||
				((app.user.uid || ajaxify.data.postSharing.length) && !post.deleted);
 | 
			
		||||
		});
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user