mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	first pass #899
This commit is contained in:
		
							
								
								
									
										24
									
								
								src/posts.js
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								src/posts.js
									
									
									
									
									
								
							| @@ -87,8 +87,6 @@ var db = require('./database'), | ||||
|  | ||||
| 					plugins.fireHook('action:post.save', postData); | ||||
|  | ||||
| 					db.searchIndex('post', content, postData.pid); | ||||
|  | ||||
| 					next(null, postData); | ||||
| 				}); | ||||
| 			} | ||||
| @@ -447,28 +445,6 @@ var db = require('./database'), | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	Posts.reIndexPids = function(pids, callback) { | ||||
|  | ||||
| 		function reIndex(pid, next) { | ||||
|  | ||||
| 			Posts.getPostField(pid, 'content', function(err, content) { | ||||
| 				if(err) { | ||||
| 					return next(err); | ||||
| 				} | ||||
|  | ||||
| 				db.searchRemove('post', pid, function() { | ||||
| 					if (content && content.length) { | ||||
| 						db.searchIndex('post', content, pid); | ||||
| 					} | ||||
| 					next(); | ||||
| 				}); | ||||
| 			}); | ||||
| 		} | ||||
|  | ||||
| 		async.each(pids, reIndex, callback); | ||||
| 	} | ||||
|  | ||||
| 	// this function should really be called User.getFavouritePosts | ||||
| 	Posts.getFavourites = function(uid, start, end, callback) { | ||||
| 		db.getSortedSetRevRange('uid:' + uid + ':favourites', start, end, function(err, pids) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user