From 9d0029cdfb0713fa92bbba3a15eed2e8967207de Mon Sep 17 00:00:00 2001 From: John Date: Thu, 18 Jun 2015 19:07:51 +0300 Subject: [PATCH] Fix whitelist --- otp/chat/WhiteList.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/otp/chat/WhiteList.py b/otp/chat/WhiteList.py index 77a2560c..b102384b 100755 --- a/otp/chat/WhiteList.py +++ b/otp/chat/WhiteList.py @@ -46,10 +46,11 @@ class WhiteList: lastWord = words[-1] - if (not lastWord) or self.isPrefix(lastWord): - newWords[-1] = lastWord - else: - newWords[-1] = self.getReplacement(lastWord, av, garbler) + if not garbler: + if (not lastWord) or self.isPrefix(lastWord): + newWords[-1] = lastWord + else: + newWords[-1] = self.getReplacement(lastWord, av, garbler) return ' '.join(newWords)