summaryrefslogtreecommitdiff
path: root/src/tab.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-10-17 17:27:07 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-10-17 17:27:07 +0000
commitf4c5e0a091e9e56e95ff687654e68e90dc6144e0 (patch)
treecb6ce6b15f3dad1b502f5065ebc42b9928e3d8e4 /src/tab.py
parent17ebb92ece4dc7b45b816bac660fed6ade9db0e7 (diff)
downloadpoezio-f4c5e0a091e9e56e95ff687654e68e90dc6144e0.tar.gz
poezio-f4c5e0a091e9e56e95ff687654e68e90dc6144e0.tar.bz2
poezio-f4c5e0a091e9e56e95ff687654e68e90dc6144e0.tar.xz
poezio-f4c5e0a091e9e56e95ff687654e68e90dc6144e0.zip
Multi-resource. Handling <presence /> stanzas. But the normal conversation window is broken :^). Fixed #1888
Diffstat (limited to 'src/tab.py')
-rw-r--r--src/tab.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/tab.py b/src/tab.py
index 4acfab08..35e71efe 100644
--- a/src/tab.py
+++ b/src/tab.py
@@ -29,8 +29,7 @@ import window
import theme
import curses
from roster import RosterGroup
-
-from common import debug
+from contact import Contact, Resource
class Tab(object):
"""
@@ -426,7 +425,10 @@ class RosterInfoTab(Tab):
def on_input(self, key):
if key in ('\n', '^J', '^M') and self.input.is_empty():
return self.on_enter()
- return self.input.do_command(key)
+ if key == ' ':
+ return self.on_space()
+ # In writting mode
+ # return self.input.do_command(key)
def on_lose_focus(self):
self._color_state = theme.COLOR_TAB_NORMAL
@@ -447,6 +449,12 @@ class RosterInfoTab(Tab):
def on_info_win_size_changed(self, _, __):
pass
+ def on_space(self):
+ selected_row = self.roster_win.get_selected_row()
+ if isinstance(selected_row, RosterGroup) or\
+ isinstance(selected_row, Contact):
+ selected_row.toggle_folded()
+ return True
def on_enter(self):
selected_row = self.roster_win.get_selected_row()
return selected_row
@@ -478,7 +486,7 @@ class ConversationTab(Tab):
def refresh(self, tabs, informations, roster):
self.text_win.refresh(self._room)
- self.info_header.refresh(self._room, roster.get_contact_by_jid(self._room.name))
+ # self.info_header.refresh(self._room, roster.get_contact_by_jid(self._room.name))
self.info_win.refresh(informations)
self.tab_win.refresh(tabs, tabs[0])
self.input.refresh()