summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-12-31 03:02:18 +0100
committermathieui <mathieui@mathieui.net>2012-12-31 03:02:18 +0100
commitd15c4e0b589a021fcffbd11a329f1ecb88bd27f0 (patch)
tree7deed859addc84bcb47e06a218a8f21da4d955d9 /src
parent1f58cb312430b9db7a9881a9b19c80fed5250b76 (diff)
downloadpoezio-d15c4e0b589a021fcffbd11a329f1ecb88bd27f0.tar.gz
poezio-d15c4e0b589a021fcffbd11a329f1ecb88bd27f0.tar.bz2
poezio-d15c4e0b589a021fcffbd11a329f1ecb88bd27f0.tar.xz
poezio-d15c4e0b589a021fcffbd11a329f1ecb88bd27f0.zip
Fix #2138 (send xhtml with /say and /correct)
Diffstat (limited to 'src')
-rw-r--r--src/tabs.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 770236d9..01266263 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -243,18 +243,25 @@ class Tab(object):
not txt.startswith('/me '):
command = txt.strip().split()[0][1:]
arg = txt[2+len(command):] # jump the '/' and the ' '
+ func = None
if command in self.commands: # check tab-specific commands
- self.commands[command][0](arg)
+ func = self.commands[command][0]
elif command in self.core.commands: # check global commands
- self.core.commands[command][0](arg)
+ func = self.core.commands[command][0]
else:
low = command.lower()
if low in self.commands:
- self.commands[low][0](arg)
+ func = self.commands[low][0]
elif low in self.core.commands:
- self.core.commands[low][0](arg)
+ func = self.core.commands[low][0]
else:
self.core.information(_("Unknown command (%s)") % (command), _('Error'))
+ if command in ('correct', 'say'): # hack
+ arg = xhtml.convert_simple_to_full_colors(arg)
+ else:
+ arg = xhtml.clean_text_simple(arg)
+ if func:
+ func(arg)
return True
else:
return False
@@ -481,8 +488,7 @@ class ChatTab(Tab):
def on_enter(self):
txt = self.input.key_enter()
if txt:
- clean_text = xhtml.clean_text_simple(txt)
- if not self.execute_command(clean_text):
+ if not self.execute_command(txt):
if txt.startswith('//'):
txt = txt[1:]
self.command_say(xhtml.convert_simple_to_full_colors(txt))