From 4e5666a4a1853b9e85ee783834f4d2d3823db445 Mon Sep 17 00:00:00 2001 From: Teremiare Date: Sun, 31 Jan 2016 22:18:18 +0100 Subject: [PATCH] Prevent chatting as a spectator when ignoring them --- js/client-chat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/client-chat.js b/js/client-chat.js index bca4e9dd2..70b3b6adf 100644 --- a/js/client-chat.js +++ b/js/client-chat.js @@ -93,7 +93,9 @@ this.tabComplete.reset(); this.chatHistory.push(text); text = this.parseCommand(text); - if (text) { + if (this.battle && this.battle.ignoreSpects && app.user.get('userid') !== this.battle.p1.id && app.user.get('userid') !== this.battle.p2.id) { + this.add("You can't chat in this battle as you're currently ignoring spectators"); + } else if (text) { this.send(text); } this.$chatbox.val('');