'use strict';

const serverEvents = require('../../chat_server_events');
const socketHub = require('../socket_hub');

module.exports = (message) => {
  console.log(`${message.sender.name} has sent a message: ${message.text}`);
  socketHub.broadcast(serverEvents.MESSAGE_RECEIVED);
};

'use strict';

const serverEvents = require('../../chat_server_events');
const socketHub = require('../socket_hub');

module.exports = (message) => {
  console.log(`${message.sender.name} has sent a message: ${message.text}`);
  socketHub.broadcast(serverEvents.MESSAGE_RECEIVED, message);
};

Include payload on message received event
Include payload on message received event
