summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-10 21:51:13 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-10 21:51:13 +0000
commit945dc664d8f9044970e631db66d660057f912843 (patch)
treee8a647a9ed3e4183dcfff385fe17a369cd57da70 /src/gui.py
parent77df6feb973f93a4f3cd834322757db8e72ddf1a (diff)
downloadpoezio-945dc664d8f9044970e631db66d660057f912843.tar.gz
poezio-945dc664d8f9044970e631db66d660057f912843.tar.bz2
poezio-945dc664d8f9044970e631db66d660057f912843.tar.xz
poezio-945dc664d8f9044970e631db66d660057f912843.zip
fix some ncurses crash. fixed #1817
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gui.py b/src/gui.py
index 1317a2c7..87fd517d 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -371,7 +371,7 @@ class Gui(object):
(from one of our contacts)
"""
from common import debug
- debug('message: %s\n' % message)
+# debug('message: %s\n' % message)
if message['type'] == 'groupchat':
return None
# Differentiate both type of messages, and call the appropriate handler.
@@ -406,7 +406,7 @@ class Gui(object):
When receiving "normal" messages (from someone in our roster)
"""
from common import debug
- debug('MESSAGE: %s\n' % (presence))
+# debug('MESSAGE: %s\n' % (presence))
return
@@ -414,7 +414,7 @@ class Gui(object):
"""
"""
from common import debug
- debug('PRESEEEEEEEEENCE: %s\n' % (presence))
+# debug('PRESEEEEEEEEENCE: %s\n' % (presence))
return
def on_roster_update(self, iq):
@@ -423,7 +423,7 @@ class Gui(object):
after a roster request, etc
"""
from common import debug
- debug("UPDATE: %s\n" % (iq))
+# debug("UPDATE: %s\n" % (iq))
for subscriber in iq['roster']['items']:
debug("subscriber: %s\n" % (iq['roster']['items'][subscriber]['subscription']))
@@ -446,8 +446,8 @@ class Gui(object):
if char in list(self.key_func.keys()):
self.key_func[char]()
else:
- # if len(char) > 1:
- # continue # ignore non-handled keyboard shortcuts
+ if not char or len(char) > 1:
+ continue # ignore non-handled keyboard shortcuts
self.window.do_command(char)
def current_room(self):
@@ -585,7 +585,7 @@ class Gui(object):
Display the error on the room window
"""
from common import debug
- debug('ERROR: %s\n' % error)
+# debug('ERROR: %s\n' % error)
room = self.get_room_by_name(room_name)
if not room:
room = self.get_room_by_name('Info')
@@ -644,6 +644,8 @@ class Gui(object):
"""
Triggered whenever a message is received from a multi-user chat room.
"""
+ from common import debug
+# debug('GROUPCHAT message: %s\n' % message)
delay_tag = message.find('{urn:xmpp:delay}delay')
if delay_tag is not None:
delayed = True
@@ -673,6 +675,7 @@ class Gui(object):
return
body = message['body']
subject = message['subject']
+# debug('======== %s, %s, %s, %s====\n'% (nick_from, room_from, body, subject))
if subject:
if nick_from:
self.add_message_to_room(room, _("%(nick)s changed the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}, time=date)