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
2
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.8.1 to 0.8.2

11

lib/controller.js

@@ -37,2 +37,3 @@ 'use strict';

var meta = _ref.meta;
var type = _ref.type;
return {

@@ -43,2 +44,3 @@ id: id, timestamp: timestamp, text: text,

author_type: author_type,
type: type,
meta: meta

@@ -171,2 +173,11 @@ };

customers.on('typing', function (chat, user, text) {
operators.emit('receive.typing', chat, user, text);
});
operators.on('typing', function (chat, user, text) {
operators.emit('receive.typing', chat, user, text);
customers.emit('receive.typing', chat, user, text);
});
customers.on('message', function (chat, message) {

@@ -173,0 +184,0 @@ // broadcast the message to

@@ -59,2 +59,7 @@ 'use strict';

socket.on('typing', function (text) {
debug('received customer typing', user.id, text);
events.emit('typing', chat, user, text);
});
socket.on('disconnect', function () {

@@ -95,2 +100,9 @@ return events.emit('leave', socketIdentifier);

});
events.on('receive.typing', function (chat, user, text) {
// customers shouldn't know who is typing or what they're typing
var isTyping = typeof text === 'string' && text.length > 0 ? true : false;
io.to(chatRoom(chat)).emit('typing', isTyping);
});
io.on('connection', function (socket) {

@@ -97,0 +109,0 @@ debug('customer connecting');

20

lib/operator/index.js

@@ -76,2 +76,6 @@ 'use strict';

var customerRoom = function customerRoom(id) {
return 'customers/' + id;
};
var queryClients = function queryClients(io, room) {

@@ -262,2 +266,9 @@ return new Promise(function (resolve, reject) {

socket.on('chat.typing', function (chat_id, text) {
var userIdentity = identityForUser(user);
debug('received operator `typing` event', userIdentity.id, chat_id, text);
events.emit('typing', { id: chat_id }, userIdentity, text);
});
socket.on('chat.join', function (chat_id) {

@@ -414,6 +425,11 @@ debug('client requesting to join', chat_id);

var room_name = 'customers/' + id;
io.in(room_name).emit('chat.message', { id: id }, message);
io.in(customerRoom(id)).emit('chat.message', { id: id }, message);
});
events.on('receive.typing', function (chat, user, text) {
var id = chat.id;
io.in(customerRoom(id)).emit('chat.typing', chat, user, text);
});
events.on('status', function (user, status) {

@@ -420,0 +436,0 @@ store.dispatch((0, _store.updateUserStatus)(user, status));

2

package.json
{
"name": "happychat-service",
"version": "0.8.1",
"version": "0.8.2",
"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