Permalink
Browse files

Fix small bugs in Toetem client.

Issues found by James O'Connor.
  • Loading branch information...
1 parent d5aefdd commit 9b0c6f33fa901292b830f3bbab1e95dcb9f2e173 @metajack committed Feb 5, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 ch11/toetem.js
View
8 ch11/toetem.js
@@ -64,7 +64,11 @@ var Toetem = {
});
});
} else if ($(message)
- .find('x > invite').attr('from') === Toetem.referee) {
+ .find('x > invite').attr('from') &&
+ Strophe.getBareJidFromJid($(message)
+ .find('x > invite')
+ .attr('from')) ===
+ Strophe.getBareJidFromJid(Toetem.referee)) {
Toetem.game = from;
Toetem.watching = false;
@@ -97,7 +101,7 @@ var Toetem = {
$('#messages').append(
"<div>&lt;<span class='" + nick_style + "'>" +
- Strophe.getBareJidFromJid(who) +
+ Strophe.getBareJidFromJid(from) +
"</span>&gt; " +
body + "</div>");

0 comments on commit 9b0c6f3

Please sign in to comment.