mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	closes #831, user profile changes
This commit is contained in:
		
							
								
								
									
										23
									
								
								src/posts.js
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								src/posts.js
									
									
									
									
									
								
							| @@ -169,11 +169,30 @@ var db = require('./database'), | ||||
| 				}); | ||||
| 			}, function(pids) { | ||||
| 				if (!(pids && pids.length)) { | ||||
| 					return callback(null, []); | ||||
| 					return callback(null, { posts: [], nextStart: 0}); | ||||
| 				} | ||||
|  | ||||
|  | ||||
| 				Posts.getPostSummaryByPids(pids, false, callback); | ||||
| 				Posts.getPostSummaryByPids(pids, false, function(err, posts) { | ||||
| 					if(err) { | ||||
| 						return callback(err); | ||||
| 					} | ||||
|  | ||||
| 					if(!posts || !posts.length) { | ||||
| 						return callback(null, { posts: [], nextStart: 0}); | ||||
| 					} | ||||
|  | ||||
| 					db.sortedSetRevRank('uid:' + uid + ':posts', posts[posts.length - 1].pid, function(err, rank) { | ||||
| 						if(err) { | ||||
| 							return calllback(err); | ||||
| 						} | ||||
| 						var userPosts = { | ||||
| 							posts: posts, | ||||
| 							nextStart: parseInt(rank, 10) + 1 | ||||
| 						}; | ||||
| 						callback(null, userPosts); | ||||
| 					}); | ||||
| 				}); | ||||
| 			}); | ||||
| 		}); | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user