Added nick change handling, the client now shows nick and quit messages, the userlist gets hidden when the chat window is not a channel

This commit is contained in:
khlieng 2015-01-31 23:35:38 +01:00
parent c421dc504b
commit 5f43b3e78e
9 changed files with 85 additions and 3 deletions

View file

@ -5,7 +5,8 @@ var socket = require('../socket');
var messageActions = Reflux.createActions([
'send',
'add'
'add',
'broadcast'
]);
messageActions.send.preEmit = function(message, to, server) {
@ -44,6 +45,14 @@ socket.on('part', function(data) {
});
});
socket.on('quit', function(data) {
messageActions.broadcast(data.user + ' has quit', data.server);
});
socket.on('nick', function(data) {
messageActions.broadcast(data.old + ' changed nick to ' + data.new, data.server);
});
socket.on('motd', function(data) {
_.each(data.content.split('\n'), function(line) {
messageActions.add({