Skip to content

Commit

Permalink
Remove surplus space prefix from battle room users (smogon#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
urkerab authored and Zarel committed Jan 16, 2018
1 parent 6465bfb commit beb21ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6593,7 +6593,11 @@ var Battle = (function () {
break;
case 'join':
case 'j':
if (this.roomid) app.rooms[this.roomid].users[toUserid(args[1])] = ' ' + args[1];
if (this.roomid) {
var user = args[1];
if (/^[a-z0-9]/i.test(user)) user = ' ' + user;
app.rooms[this.roomid].users[toUserid(user)] = user;
}
if (!this.ignoreSpects) {
this.log('<div class="chat"><small>' + Tools.escapeHTML(args[1]) + ' joined.</small></div>', preempt);
}
Expand Down

0 comments on commit beb21ac

Please sign in to comment.