feature/IO-3000-messaging-sockets-migration2 - Final Modifications

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-11-25 12:46:10 -08:00
parent 62dd3d7e8e
commit c3c66f9646
4 changed files with 77 additions and 129 deletions

View File

@@ -188,19 +188,6 @@ const redisSocketEvents = ({
}
};
const messageAdded = ({ bodyshopId, conversationId, message }) => {
try {
const room = getBodyshopConversationRoom({ bodyshopId, conversationId });
io.to(room).emit("new-message", { message, conversationId });
} catch (error) {
logger.log("Failed to handle new message", "error", "io-redis", null, {
error: error.message,
stack: error.stack
});
}
};
socket.on("message-added", messageAdded);
socket.on("conversation-modified", conversationModified);
socket.on("join-bodyshop-conversation", joinConversationRoom);
socket.on("leave-bodyshop-conversation", leaveConversationRoom);