Browse files

Merge branch 'refactor'

  • Loading branch information...
2 parents 90bfc2b + 430e70a commit 7ffb656b9f3695099bc4130984cf001ebc53163d @dj-emberex dj-emberex committed Mar 2, 2012
Showing with 12 additions and 0 deletions.
  1. +8 −0 assets/js/client.js
  2. +4 −0 lib/irchandler.js
View
8 assets/js/client.js
@@ -283,6 +283,14 @@ $(function() {
irc.appView.channelList.channelTabs[0].setActive();
}
break;
+ case '/topic':
+ if (commandText[2]) {
+ irc.socket.emit('topic', {name: commandText[1], topic: commandText[2]});
+ } else {
+ irc.socket.emit('topic', {name: irc.chatWindows.getActive().get('name'),
+ topic: commandText[1]});
+ }
+ break;
case '/me':
irc.socket.emit('action', {
target: irc.chatWindows.getActive().get('name'),
View
4 lib/irchandler.js
@@ -197,6 +197,10 @@ var irchandler = exports.irchandler = function(socket) {
);
});
+ socket.on('topic', function(data){
+ client.send('TOPIC ' + data.name + ' ' + data.topic);
+ });
+
socket.on('command', function(text) { console.log(text); client.send(text); });
socket.on('disconnect', function() {

0 comments on commit 7ffb656

Please sign in to comment.