2015-01-17 01:37:21 +00:00
|
|
|
var Reflux = require('reflux');
|
2015-01-22 00:03:25 +00:00
|
|
|
var _ = require('lodash');
|
2015-01-17 01:37:21 +00:00
|
|
|
|
2015-01-21 23:32:32 +00:00
|
|
|
var socket = require('../socket');
|
2015-01-21 02:06:34 +00:00
|
|
|
|
2015-01-17 01:37:21 +00:00
|
|
|
var messageActions = Reflux.createActions([
|
|
|
|
'send',
|
2015-01-31 22:35:38 +00:00
|
|
|
'add',
|
2015-02-01 00:56:56 +00:00
|
|
|
'broadcast',
|
2015-02-09 00:00:30 +00:00
|
|
|
'inform',
|
|
|
|
'command'
|
2015-01-17 01:37:21 +00:00
|
|
|
]);
|
|
|
|
|
2015-01-21 02:06:34 +00:00
|
|
|
messageActions.send.preEmit = function(message, to, server) {
|
2015-01-21 23:14:28 +00:00
|
|
|
socket.send('chat', {
|
2015-01-21 02:06:34 +00:00
|
|
|
server: server,
|
|
|
|
to: to,
|
|
|
|
message: message
|
|
|
|
});
|
2015-01-17 01:37:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = messageActions;
|