Skip to content

Commit

Permalink
Is this a fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
DanBUK committed Feb 6, 2011
1 parent b57ad09 commit 310aceb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 11 additions & 9 deletions irc.js
Expand Up @@ -55,15 +55,17 @@ socket.on('connection', function(client) {
irc.privmsg(message.person.nick, "I can only talk in #nodester.");
}
});
} else if (obj.hasOwnProperty('messagetype')) {
switch (obj.messagetype) {
case "message":
irc.privmsg("#nodester", obj.message);
break;
default:
console.log(data);
break;
}
} else {
// Maybe handle updaing of nicks one day :)
}
} else if (obj.hasOwnProperty('messagetype')) {
switch (obj.messagetype) {
case "message":
irc.privmsg("#nodester", obj.message);
break;
default:
console.log(data);
break;
}
}
});
Expand Down
3 changes: 1 addition & 2 deletions public/index.html
Expand Up @@ -65,12 +65,12 @@
var handleMessage = function (data) {
var obj = JSON.parse(data);
if (nickname === null) {
alert("null nickname");
var tmp = getNickname();
if (tmp !== null) {
nickname = tmp;
rv = sock.send(JSON.stringify({ nickname: nickname }));
}
// rv = sock.send(JSON.stringify({ nickname: name }));
} else {
if (obj.hasOwnProperty('messagetype')) {
switch (obj.messagetype) {
Expand All @@ -85,7 +85,6 @@
}
}
}
// ts.textContent = obj.timestamp;
};
var sendMessage = function () {
sock.send(JSON.stringify({
Expand Down

0 comments on commit 310aceb

Please sign in to comment.