mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 23:32:02 -05:00
Support |c|USER|/log MESSAGE
The new /log syntax is analogous to /me and /announce Doing it this way makes it easier to support by bots, and also makes it not highlight the initiator but still highlight others which is usually desired. Closes #760
This commit is contained in:
@@ -457,6 +457,8 @@ var Tools = {
|
||||
];
|
||||
case 'announce':
|
||||
return '<div class="chat chatmessage-' + toId(name) + hlClass + mineClass + '">' + timestamp + '<strong style="' + color + '">' + clickableName + ':</strong> <span class="message-announce">' + Tools.parseMessage(target) + '</span></div>';
|
||||
case 'log':
|
||||
return '<div class="chat chatmessage-' + toId(name) + hlClass + mineClass + '">' + timestamp + '<span class="message-log">' + Tools.parseMessage(target) + '</span></div>';
|
||||
case 'data-pokemon':
|
||||
var buf = '<li class="result">';
|
||||
var template = Tools.getTemplate(target);
|
||||
|
||||
@@ -1445,9 +1445,11 @@
|
||||
this.subtleNotifyOnce();
|
||||
}
|
||||
|
||||
if (message.substr(0, 4) === '/me ' || message.substr(0, 5) === '/mee') {
|
||||
Storage.logChat(this.id, '* ' + name + (message.substr(0, 4) === '/me ' ? ' ' : '') + message);
|
||||
} else if (message.substr(0, 10) === '/announce ' || message.substr(0, 1) !== '/') {
|
||||
if (message.slice(0, 4) === '/me ' || message.slice(0, 5) === '/mee') {
|
||||
Storage.logChat(this.id, '* ' + name + (message.slice(0, 4) === '/me ' ? ' ' : '') + message);
|
||||
} else if (message.slice(0, 5) === '/log ') {
|
||||
Storage.logChat(this.id, '' + message.slice(5));
|
||||
} else {
|
||||
Storage.logChat(this.id, '' + name + ': ' + message);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user