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