mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	modules fixes
This commit is contained in:
		@@ -33,7 +33,11 @@ SocketModules.composer.push = function(socket, pid, callback) {
 | 
				
			|||||||
					});
 | 
										});
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			], function(err, results) {
 | 
								], function(err, results) {
 | 
				
			||||||
				callback(err, {
 | 
									if(err) {
 | 
				
			||||||
 | 
										return callback(err);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									callback(null, {
 | 
				
			||||||
					title: results[1],
 | 
										title: results[1],
 | 
				
			||||||
					pid: pid,
 | 
										pid: pid,
 | 
				
			||||||
					body: results[0].content
 | 
										body: results[0].content
 | 
				
			||||||
@@ -64,11 +68,17 @@ SocketModules.composer.editCheck = function(socket, pid, callback) {
 | 
				
			|||||||
SocketModules.chats = {};
 | 
					SocketModules.chats = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SocketModules.chats.get = function(socket, data, callback) {
 | 
					SocketModules.chats.get = function(socket, data, callback) {
 | 
				
			||||||
	var touid = data.touid;
 | 
						if(!data) {
 | 
				
			||||||
	Messaging.getMessages(socket.uid, touid, callback);
 | 
							return callback(new Error('invalid data'));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						Messaging.getMessages(socket.uid, data.touid, callback);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SocketModules.chats.send = function(socket, data) {
 | 
					SocketModules.chats.send = function(socket, data) {
 | 
				
			||||||
 | 
						if(!data) {
 | 
				
			||||||
 | 
							return callback(new Error('invalid data'));
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var touid = data.touid;
 | 
						var touid = data.touid;
 | 
				
			||||||
	if (touid === socket.uid || socket.uid === 0) {
 | 
						if (touid === socket.uid || socket.uid === 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user