Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Is this a fix?

  • Loading branch information...
commit 310aceba089d52011adfe0deb32b963be631ebd4 1 parent b57ad09
@DanBUK authored
Showing with 12 additions and 11 deletions.
  1. +11 −9 irc.js
  2. +1 −2  public/index.html
View
20 irc.js
@@ -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;
}
}
});
View
3  public/index.html
@@ -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) {
@@ -85,7 +85,6 @@
}
}
}
- // ts.textContent = obj.timestamp;
};
var sendMessage = function () {
sock.send(JSON.stringify({
Please sign in to comment.
Something went wrong with that request. Please try again.