mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 07:50:37 +01:00
feat: typing user list in chat
This commit is contained in:
@@ -97,6 +97,19 @@ function onConnection(socket) {
|
||||
}, onMessage, socket, payload);
|
||||
});
|
||||
|
||||
socket.on('disconnecting', () => {
|
||||
for (const room of socket.rooms) {
|
||||
if (room && room.match(/^chat_room_\d+$/)) {
|
||||
Sockets.server.in(room).emit('event:chats.typing', {
|
||||
roomId: room.split('_').pop(),
|
||||
uid: socket.uid,
|
||||
username: '',
|
||||
typing: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('disconnect', () => {
|
||||
onDisconnect(socket);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user