summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-03-24 16:44:55 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-03-24 16:44:55 +0000
commit899a33ae477df3dec4541cb86d65783677d37211 (patch)
tree270ae36f397c6fef2cdc281290df86b71a305c65 /src/gui.py
parent42fbbddbd4e751e7d13c76cff46b1bc66fc790d9 (diff)
downloadpoezio-899a33ae477df3dec4541cb86d65783677d37211.tar.gz
poezio-899a33ae477df3dec4541cb86d65783677d37211.tar.bz2
poezio-899a33ae477df3dec4541cb86d65783677d37211.tar.xz
poezio-899a33ae477df3dec4541cb86d65783677d37211.zip
fixed #1235 (affiche un message si la connexion echoue)
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui.py b/src/gui.py
index b9a02703..3253561f 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -106,6 +106,7 @@ class Gui(object):
self.handler.connect('join-room', self.join_room)
self.handler.connect('room-presence', self.room_presence)
self.handler.connect('room-message', self.room_message)
+ self.handler.connect('error', self.information)
def main_loop(self, stdscr):
while 1:
@@ -260,7 +261,7 @@ class Gui(object):
from_room = stanza.getFrom().getStripped()
room = self.get_room_by_name(from_room)
if not room:
- self.information(_("presence received for a non-existing room: %s") % (from_room))
+ return
if stanza.getType() == 'error':
msg = _("Error: %s") % stanza.getError()
else:
@@ -294,7 +295,10 @@ class Gui(object):
# kick
elif kick:
room.users.remove(user)
- reason = stanza.getReason().encode('utf-8') or ''
+ try:
+ reason = stanza.getReason().encode('utf-8')
+ except:
+ reason = ''
try:
by = stanza.getActor().encode('utf-8')
except:
@@ -444,8 +448,10 @@ class Gui(object):
self.information(_("already in room [%s]") % room)
return
self.muc.join_room(room, nick)
- if not r: # if the room window exists, we don't recreate it.
+ if not r: # if the room window exists, we don't recreate it.
self.join_room(room, nick)
+ else:
+ r.users = []
def command_bookmark(self, args):
nick = None
@@ -562,7 +568,6 @@ class Gui(object):
def information(self, msg):
room = self.get_room_by_name("Info")
- info = room.add_info(msg)
self.add_info(room, msg)
def command_quit(self, args):