mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
send messages
This commit is contained in:
@@ -197,10 +197,20 @@ SocketModules.chats.userStopTyping = function(socket, data, callback) {
|
||||
};
|
||||
|
||||
function sendTypingNotification(event, socket, data, callback) {
|
||||
if (!socket.uid || !data) {
|
||||
if (!socket.uid || !data || !data.roomId) {
|
||||
return;
|
||||
}
|
||||
server.in('uid_' + data.touid).emit(event, data.fromUid);
|
||||
|
||||
Messaging.getUidsInRoom(data.roomId, 0, -1, function(err, uids) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
uids.forEach(function(uid) {
|
||||
if (socket.uid !== parseInt(uid, 10)) {
|
||||
server.in('uid_' + uid).emit(event, data.fromUid);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
SocketModules.chats.getRecentChats = function(socket, data, callback) {
|
||||
|
||||
Reference in New Issue
Block a user