summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-19 19:38:33 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-19 19:38:33 +0000
commite656e5924bef38d5e69fffca6e1d46c7bed69139 (patch)
tree34d5a397997a4d1bd0fbd0de660d7dc7b77ce287 /src/gui.py
parent93351156a122dd7e374778c1c838b5c4c1dda83d (diff)
downloadpoezio-e656e5924bef38d5e69fffca6e1d46c7bed69139.tar.gz
poezio-e656e5924bef38d5e69fffca6e1d46c7bed69139.tar.bz2
poezio-e656e5924bef38d5e69fffca6e1d46c7bed69139.tar.xz
poezio-e656e5924bef38d5e69fffca6e1d46c7bed69139.zip
fixes some stuff. Also fixed #1617
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui.py b/src/gui.py
index 96f27907..74194b6d 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -145,8 +145,8 @@ class Gui(object):
if char in self.key_func.keys():
self.key_func[char]()
else:
- # if len(char) > 1:
- # continue # ignore non-handled keyboard shortcuts
+ if len(char.decode('utf-8')) > 1:
+ continue # ignore non-handled keyboard shortcuts
self.window.do_command(char)
def current_room(self):
@@ -343,12 +343,15 @@ class Gui(object):
room = self.get_room_by_name(jid) # get the tab with the private conversation
if not room: # It's the first message we receive: create the tab
room = self.open_private_window(room_from, nick_from, False)
+ if not room:
+ return
body = stanza.getBody()
self.add_message_to_room(room, body, None, nick_from)
self.window.input.refresh()
doupdate()
def open_private_window(self, room_name, user_nick, focus=True):
+ print anus
complete_jid = room_name+'/'+user_nick
for room in self.rooms: # if the room exists, focus it and return
if room.jid:
@@ -356,7 +359,10 @@ class Gui(object):
self.command_win(str(room.nb))
return
# create the new tab
- own_nick = self.get_room_by_name(room_name).own_nick
+ room = self.get_room_by_name(room_name)
+ if not room:
+ return None
+ own_nick = room.own_nick
r = Room(complete_jid, own_nick, self.window, complete_jid)
# insert it in the rooms
if self.current_room().nb == 0:
@@ -377,6 +383,7 @@ class Gui(object):
"""
Display the message on the room window
"""
+ delay_tag = stanza.getTag('delay', namespace='urn:xmpp:delay')
if delay_tag:
delayed = True
date = common.datetime_tuple(delay_tag.getAttr('stamp'))