summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 801e0793..8d4e6447 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -395,7 +395,6 @@ class MucTab(ChatTab):
self.ignores = [] # set of Users
# keys
self.key_func['^I'] = self.completion
- self.key_func['M-i'] = self.completion
self.key_func['M-u'] = self.scroll_user_list_down
self.key_func['M-y'] = self.scroll_user_list_up
# commands
@@ -979,7 +978,6 @@ class PrivateTab(ChatTab):
self.input = windows.MessageInput()
# keys
self.key_func['^I'] = self.completion
- self.key_func['M-i'] = self.completion
# commands
self.commands['unquery'] = (self.command_unquery, _("Usage: /unquery\nUnquery: close the tab"), None)
self.commands['part'] = (self.command_unquery, _("Usage: /part\Part: close the tab"), None)
@@ -991,7 +989,11 @@ class PrivateTab(ChatTab):
def command_say(self, line):
msg = self.core.xmpp.make_message(self.get_name())
msg['type'] = 'chat'
- msg['body'] = line
+ if line.find('\x19') == -1:
+ msg['body'] = line
+ else:
+ msg['body'] = xhtml.clean_text(line)
+ msg['xhtml_im'] = xhtml.poezio_colors_to_html(line)
if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates is not False:
msg['chat_state'] = 'active'
msg.send()
@@ -1049,7 +1051,8 @@ class PrivateTab(ChatTab):
empty_before = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//'))
self.input.do_command(key)
empty_after = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//'))
- self.send_composing_chat_state(empty_before, empty_after)
+ if self.core.get_tab_by_name(JID(self.get_room().name).bare, MucTab).get_room().joined:
+ self.send_composing_chat_state(empty_before, empty_after)
return False
def on_lose_focus(self):
@@ -1062,7 +1065,7 @@ class PrivateTab(ChatTab):
def on_gain_focus(self):
self._room.set_color_state(theme.COLOR_TAB_CURRENT)
curses.curs_set(1)
- if config.get('send_chat_states', 'true') == 'true' and not self.input.get_text():
+ if self.get_room().joined and config.get('send_chat_states', 'true') == 'true' and not self.input.get_text():
self.send_chat_state('active')
def on_scroll_up(self):
@@ -1118,7 +1121,6 @@ class RosterInfoTab(Tab):
self.input = self.default_help_message
self.set_color_state(theme.COLOR_TAB_NORMAL)
self.key_func['^I'] = self.completion
- self.key_func['M-i'] = self.completion
self.key_func[' '] = self.on_space
self.key_func["/"] = self.on_slash
self.key_func["KEY_UP"] = self.move_cursor_up
@@ -1465,7 +1467,6 @@ class ConversationTab(ChatTab):
self.input = windows.MessageInput()
# keys
self.key_func['^I'] = self.completion
- self.key_func['M-i'] = self.completion
# commands
self.commands['unquery'] = (self.command_unquery, _("Usage: /unquery\nUnquery: close the tab"), None)
self.commands['part'] = (self.command_unquery, _("Usage: /part\Part: close the tab"), None)
@@ -1477,7 +1478,11 @@ class ConversationTab(ChatTab):
def command_say(self, line):
msg = self.core.xmpp.make_message(self.get_name())
msg['type'] = 'chat'
- msg['body'] = line
+ if line.find('\x19') == -1:
+ msg['body'] = line
+ else:
+ msg['body'] = xhtml.clean_text(line)
+ msg['xhtml_im'] = xhtml.poezio_colors_to_html(line)
if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates is not False:
msg['chat_state'] = 'active'
msg.send()
@@ -1593,7 +1598,6 @@ class MucListTab(Tab):
self.key_func["KEY_DOWN"] = self.listview.move_cursor_down
self.key_func["KEY_UP"] = self.listview.move_cursor_up
self.key_func['^I'] = self.completion
- self.key_func['M-i'] = self.completion
self.key_func["/"] = self.on_slash
self.key_func['j'] = self.join_selected
self.key_func['J'] = self.join_selected_no_focus