mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	removed unused functions
This commit is contained in:
		
							
								
								
									
										23
									
								
								src/posts.js
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								src/posts.js
									
									
									
									
									
								
							| @@ -522,29 +522,6 @@ var async = require('async'), | |||||||
| 		}); | 		}); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	Posts.getPidPage = function(pid, uid, callback) { |  | ||||||
| 		if(!pid) { |  | ||||||
| 			return callback(new Error('[[error:invalid-pid]]')); |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 		var index = 0; |  | ||||||
| 		async.waterfall([ |  | ||||||
| 			function(next) { |  | ||||||
| 				Posts.getPidIndex(pid, next); |  | ||||||
| 			}, |  | ||||||
| 			function(result, next) { |  | ||||||
| 				index = result; |  | ||||||
| 				if (index === 1) { |  | ||||||
| 					return callback(null, 1); |  | ||||||
| 				} |  | ||||||
| 				user.getSettings(uid, next); |  | ||||||
| 			}, |  | ||||||
| 			function(settings, next) { |  | ||||||
| 				next(null, Math.ceil((index - 1) / settings.postsPerPage)); |  | ||||||
| 			} |  | ||||||
| 		], callback); |  | ||||||
| 	}; |  | ||||||
|  |  | ||||||
| 	Posts.getPidIndex = function(pid, callback) { | 	Posts.getPidIndex = function(pid, callback) { | ||||||
| 		Posts.getPostField(pid, 'tid', function(err, tid) { | 		Posts.getPostField(pid, 'tid', function(err, tid) { | ||||||
| 			if(err) { | 			if(err) { | ||||||
|   | |||||||
| @@ -268,15 +268,6 @@ SocketPosts.getUpvoters = function(socket, pid, callback) { | |||||||
| 	}); | 	}); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  |  | ||||||
| SocketPosts.getPidPage = function(socket, pid, callback) { |  | ||||||
| 	posts.getPidPage(pid, socket.uid, callback); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| SocketPosts.getPidIndex = function(socket, pid, callback) { |  | ||||||
| 	posts.getPidIndex(pid, callback); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| SocketPosts.flag = function(socket, pid, callback) { | SocketPosts.flag = function(socket, pid, callback) { | ||||||
| 	if (!socket.uid) { | 	if (!socket.uid) { | ||||||
| 		return callback(new Error('[[error:not-logged-in]]')); | 		return callback(new Error('[[error:not-logged-in]]')); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user