mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 15:22:35 -05:00
Attribute /raw messages, fix /uhtml in chat (#1475)
This commit is contained in:
@@ -1611,7 +1611,7 @@
|
||||
}
|
||||
|
||||
var isHighlighted = userid !== app.user.get('userid') && this.getHighlight(message);
|
||||
var parsedMessage = MainMenuRoom.parseChatMessage(message, name, ChatRoom.getTimestamp('chat', msgTime), isHighlighted);
|
||||
var parsedMessage = MainMenuRoom.parseChatMessage(message, name, ChatRoom.getTimestamp('chat', msgTime), isHighlighted, this.$chat);
|
||||
if (typeof parsedMessage === 'object' && 'noNotify' in parsedMessage) {
|
||||
mayNotify = mayNotify && !parsedMessage.noNotify;
|
||||
parsedMessage = parsedMessage.message;
|
||||
|
||||
@@ -1023,16 +1023,16 @@
|
||||
if (!html) {
|
||||
$elements.remove();
|
||||
} else if (!$elements.length) {
|
||||
$chatElem.append('<div class="chat uhtml-' + toID(parts[0]) + '">' + BattleLog.sanitizeHTML(html) + '</div>');
|
||||
$chatElem.append('<div class="chat uhtml-' + toID(parts[0]) + ' chatmessage-' + toID(name) + '">' + BattleLog.sanitizeHTML(html) + '</div>');
|
||||
} else if (cmd === 'uhtmlchange') {
|
||||
$elements.html(BattleLog.sanitizeHTML(html));
|
||||
} else {
|
||||
$elements.remove();
|
||||
$chatElem.append('<div class="chat uhtml-' + toID(parts[0]) + '">' + BattleLog.sanitizeHTML(html) + '</div>');
|
||||
$chatElem.append('<div class="chat uhtml-' + toID(parts[0]) + ' chatmessage-' + toID(name) + '">' + BattleLog.sanitizeHTML(html) + '</div>');
|
||||
}
|
||||
return '';
|
||||
case 'raw':
|
||||
return '<div class="chat">' + BattleLog.sanitizeHTML(target) + '</div>';
|
||||
return '<div class="chat chatmessage-' + toID(name) + '">' + BattleLog.sanitizeHTML(target) + '</div>';
|
||||
case 'nonotify':
|
||||
return {message: '<div class="chat">' + timestamp + BattleLog.sanitizeHTML(target) + '</div>', noNotify: true};
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user