Skip to content

Commit

Permalink
Battles: Half-support chat messages with timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarel committed Dec 18, 2017
1 parent e466dbb commit 31722b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6484,9 +6484,16 @@ var Battle = (function () {
this.rated = true;
this.log('<div class="rated"><strong>' + (Tools.escapeHTML(args[1]) || 'Rated battle') + '</strong></div>');
break;
case ':':
break;
case 'chat':
case 'c':
case 'c:':
var pipeIndex = args[1].indexOf('|');
if (args[0] === 'c:') {
args[1] = args[1].slice(pipeIndex + 1);
pipeIndex = args[1].indexOf('|');
}
var name = args[1].slice(0, pipeIndex);
var rank = name.charAt(0);
if (this.ignoreSpects && (rank === ' ' || rank === '+')) break;
Expand Down Expand Up @@ -6779,7 +6786,7 @@ var Battle = (function () {
args = str.substr(1).split('|');
}
switch (args[0]) {
case 'c': case 'chat':
case 'c': case 'c:': case 'chat':
case 'chatmsg': case 'chatmsg-raw': case 'raw': case 'error': case 'html':
case 'inactive': case 'inactiveoff': case 'warning':
case 'fieldhtml': case 'controlshtml':
Expand Down

2 comments on commit 31722b1

@panpawn
Copy link
Contributor

@panpawn panpawn commented on 31722b1 Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might of introduced a bug where chat messages end in a stray | mark? See replay for reference

@Zarel
Copy link
Member Author

@Zarel Zarel commented on 31722b1 Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that was this bug, fixed three days ago:

smogon/pokemon-showdown#4307

Please sign in to comment.