New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

happychat-service

Package Overview
Dependencies
Maintainers
3
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

happychat-service - npm Package Compare versions

Comparing version 0.10.6 to 0.10.7

21

lib/middlewares/socket-io/chatlist.js

@@ -148,2 +148,16 @@ 'use strict';

var removeOperatorsFromChat = function removeOperatorsFromChat(chat) {
var room = (0, _index.customerRoom)(chat.id);
return getClients(operator_io, room).then(function (clients) {
return Promise.all((0, _ramda.map)(function (socket) {
return new Promise(function (resolve, reject) {
socket.leave(room, function (e) {
if (e) return reject(e);
resolve(socket);
});
});
}, clients));
});
};
var removeOperatorFromChat = function removeOperatorFromChat(operator, chat) {

@@ -282,6 +296,6 @@ var customer_room_name = (0, _index.customerRoom)(chat.id);

// remove all operator clients from the room
store.dispatch((0, _actions.operatorInboundMessage)(chat.id, operator, (0, _ramda.merge)((0, _util.makeEventMessage)('operator left', chat.id), { meta: { operator: operator, event_type: 'leave' } })));
removeOperatorFromChat(operator, chat).then(function () {
// send redux action to update loads
debug('removed operator from chat', operator.id);
store.dispatch((0, _actions.operatorInboundMessage)(chat.id, operator, (0, _ramda.merge)((0, _util.makeEventMessage)('operator left', chat.id), { meta: { operator: operator, event_type: 'leave' } })));
}, function (e) {

@@ -321,2 +335,7 @@ return debug('failed to remove operator from chat', e);

store.dispatch((0, _actions.operatorInboundMessage)(chat_id, operator, (0, _ramda.merge)((0, _util.makeEventMessage)('chat closed', chat_id), { meta: { event_type: 'close', by: action.operator } })));
removeOperatorsFromChat(chat).then(function () {
return debug('removed all operators from chat stream', chat_id);
}, function (e) {
return debug('failed to remove operator sockets from chat', chat_id, e);
});
};

@@ -323,0 +342,0 @@

2

package.json
{
"name": "happychat-service",
"version": "0.10.6",
"version": "0.10.7",
"description": "Socket.IO based chat server for happychat.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc