Update client dependencies

This commit is contained in:
Ken-Håvard Lieng 2016-02-04 03:35:50 +01:00
parent dbe9d03352
commit 7108fa572c
19 changed files with 109 additions and 116 deletions

View file

@ -1,20 +1,18 @@
import * as actions from '../actions';
export function sendMessage(message, to, server) {
return (dispatch, getState) => {
return dispatch({
type: actions.SEND_MESSAGE,
from: getState().servers.getIn([server, 'nick']),
message,
to,
server,
time: new Date(),
socket: {
type: 'chat',
data: { message, to, server }
}
});
};
return (dispatch, getState) => dispatch({
type: actions.SEND_MESSAGE,
from: getState().servers.getIn([server, 'nick']),
message,
to,
server,
time: new Date(),
socket: {
type: 'chat',
data: { message, to, server }
}
});
}
export function addMessage(message) {
@ -37,26 +35,22 @@ export function addMessages(messages) {
}
export function broadcast(message, server, channels) {
return addMessages(channels.map(channel => {
return {
server,
to: channel,
message,
type: 'info'
};
}));
return addMessages(channels.map(channel => ({
server,
to: channel,
message,
type: 'info'
})));
}
export function inform(message, server, channel) {
if (Array.isArray(message)) {
return addMessages(message.map(msg => {
return {
server,
to: channel,
message: msg,
type: 'info'
};
}));
return addMessages(message.map(msg => ({
server,
to: channel,
message: msg,
type: 'info'
})));
}
return addMessage({