2015-01-17 01:37:21 +00:00
|
|
|
var Reflux = require('reflux');
|
|
|
|
|
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',
|
2015-02-15 22:27:00 +00:00
|
|
|
'command',
|
|
|
|
'setWrapWidth'
|
2015-01-17 01:37:21 +00:00
|
|
|
]);
|
|
|
|
|
2015-02-21 10:36:10 +00:00
|
|
|
messageActions.send.preEmit = (message, to, server) => {
|
|
|
|
socket.send('chat', { server, to, message });
|
2015-01-17 01:37:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = messageActions;
|