From d0b1349cf4b0c7378cb83508737aa7b301dd0ea8 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 24 Feb 2011 20:27:53 +0100 Subject: [PATCH] =?UTF-8?q?Better=20handle=20the=20'not=20composing,=20jus?= =?UTF-8?q?t=20typing=20a=20command',=20the=20user=20cannot=20trick=20the?= =?UTF-8?q?=20system=20by=20doing=20(e.g),=20"w,=20=E2=86=90,=20/,=20ENTER?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tabs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tabs.py b/src/tabs.py index bf903310..4bc2ed99 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1165,14 +1165,15 @@ class ConversationTab(ChatTab, TabWithInfoWin): if key in self.key_func: self.key_func[key]() return False - empty_before = self.input.get_text() == '' + empty_before = self.input.get_text() == '' or self.input.get_text().startswith('/') self.input.do_command(key) - if not self.input.get_text() and not empty_before: + empty_after = self.input.get_text() == '' or self.input.get_text().startswith('/') + if not empty_before and empty_after: msg = self.core.xmpp.make_message(self.get_name()) msg['type'] = 'chat' msg['chat_state'] = 'active' msg.send() - elif self.input.get_text() and empty_before and not self.input.get_text().startswith('/'): + elif empty_before and not empty_after: msg = self.core.xmpp.make_message(self.get_name()) msg['type'] = 'chat' msg['chat_state'] = 'composing'