Mercurial > xib
diff participant.py @ 65:75604669fcd9
Some fault tolerance
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 30 Aug 2009 13:05:00 +0200 |
parents | 8fc496eaa17b |
children | 91b98275f2eb |
line wrap: on
line diff
--- a/participant.py +++ b/participant.py @@ -18,7 +18,7 @@ import muc xmpp = muc.xmpp del muc -import irclib +from irclib import ServerNotConnectedError from encoding import * from threading import Thread from time import sleep @@ -149,7 +149,10 @@ class participant: def sayOnIRC(self, message): try: if self.irc_connection != None: - self.irc_connection.privmsg(self.bridge.irc_room, message) + try: + self.irc_connection.privmsg(self.bridge.irc_room, message) + except ServerNotConnectedError: + self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) elif self.xmpp_c == None: self.bridge.irc_connection.privmsg(self.bridge.irc_room, '<'+self.nickname+'> '+message) except EncodingException: