diff --git a/client/src/js/command.js b/client/src/js/command.js index d0b50116..ab53890a 100644 --- a/client/src/js/command.js +++ b/client/src/js/command.js @@ -1,3 +1,5 @@ +var _ = require('lodash'); + var channelStore = require('./stores/channel'); var channelActions = require('./actions/channel'); var messageActions = require('./actions/message'); @@ -27,7 +29,9 @@ messageActions.command.listen(function(line, channel, server) { break; case 'part': - if (channel) { + if (params[1]) { + channelActions.part([params[1]], server); + } else if (channel) { channelActions.part([channel], server); } break; @@ -88,5 +92,19 @@ messageActions.command.listen(function(line, channel, server) { case 'away': serverActions.away(params[1], server); break; + + case 'help': + messageActions.inform([ + _.escape('/join - Join a channel'), + '/part [channel] - Leave the current or entered channel', + _.escape('/nick - Change nick'), + '/quit - Disconnect from the current server', + _.escape('/me - Send action message'), + '/topic - Show topic for the current channel', + _.escape('/msg - Send message to the entered channel or user'), + _.escape('/say - Send message to the current chat'), + '/away [message] - Set or clear away message' + ], server, channel); + break; } }); \ No newline at end of file diff --git a/client/src/js/irc.js b/client/src/js/irc.js index 2af4595a..09d6fdb5 100644 --- a/client/src/js/irc.js +++ b/client/src/js/irc.js @@ -59,12 +59,14 @@ socket.on('mode', function(data) { socket.on('whois', function(data) { var tab = selectedTabStore.getState(); - messageActions.inform('Nick: ' + data.nick, tab.server, tab.channel); - messageActions.inform('Username: ' + data.username, tab.server, tab.channel); - messageActions.inform('Realname: ' + data.realname, tab.server, tab.channel); - messageActions.inform('Host: ' + data.host, tab.server, tab.channel); - messageActions.inform('Server: ' + data.server, tab.server, tab.channel); - messageActions.inform('Channels: ' + data.channels, tab.server, tab.channel); + messageActions.inform([ + 'Nick: ' + data.nick, + 'Username: ' + data.username, + 'Realname: ' + data.realname, + 'Host: ' + data.host, + 'Server: ' + data.server, + 'Channels: ' + data.channels + ], tab.server, tab.channel); }); socket.on('servers', function(data) { diff --git a/client/src/js/stores/message.js b/client/src/js/stores/message.js index 8da33140..a8c1ab66 100644 --- a/client/src/js/stores/message.js +++ b/client/src/js/stores/message.js @@ -72,12 +72,24 @@ var messageStore = Reflux.createStore({ }, inform: function(message, server, channel) { - addMessage({ - server: server, - to: channel, - message: message, - type: 'info' - }, channel || server); + if (_.isArray(message)) { + _.each(message, (msg) => { + addMessage({ + server: server, + to: channel, + message: msg, + type: 'info' + }, channel || server); + }); + } else { + addMessage({ + server: server, + to: channel, + message: message, + type: 'info' + }, channel || server); + } + this.trigger(messages); },