mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 18:46:01 +01:00 
			
		
		
		
	replies are up
This commit is contained in:
		
							
								
								
									
										13
									
								
								src/posts.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/posts.js
									
									
									
									
									
								
							| @@ -48,7 +48,7 @@ var	RDB = require('./redis.js'), | ||||
| 							}); | ||||
| 						} | ||||
|  | ||||
| 						callback({'posts': posts, 'TOPIC_ID': tid}); | ||||
| 						callback({'TOPIC_ID': tid, 'posts': posts}); | ||||
| 					}); | ||||
| 			} else { | ||||
| 				callback({}); | ||||
| @@ -60,8 +60,17 @@ var	RDB = require('./redis.js'), | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	Posts.reply = function() { | ||||
| 	Posts.reply = function(tid, uid, content) { | ||||
| 		Posts.create(uid, content, function(pid) { | ||||
| 			RDB.rpush('tid:' + tid + ':posts', pid); | ||||
|  | ||||
| 			global.socket.emit('event:alert', { | ||||
| 				title: 'Reply Successful', | ||||
| 				message: 'You have successfully replied. Click here to view your reply.', | ||||
| 				type: 'notify', | ||||
| 				timeout: 2000 | ||||
| 			}); | ||||
| 		}); | ||||
| 	}; | ||||
|  | ||||
| 	Posts.create = function(uid, content, callback) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user