# HG changeset patch # User Charly COSTE # Date 1268070427 -3600 # Node ID 303e571bc10400804647c5229456f35b01a9cd74 # Parent 5e65f52be453f3a43d0078aaf4fb8415536a375f catch ServerNotConnectedError in Participant.say_on_irc_to Signed-off-by: Charly COSTE diff --git a/participant.py b/participant.py --- a/participant.py +++ b/participant.py @@ -305,9 +305,17 @@ class Participant: def say_on_irc_to(self, to, message): + error = False if isinstance(self.irc_connection, ServerConnection): - self.irc_connection.privmsg(to, message) + try: + self.irc_connection.privmsg(to, message) + except ServerNotConnectedError: + self.irc_connection.connect() + error = True elif not isinstance(self.xmpp_c, xmpp.client.Client): + error = True + + if error: if self.bridge.mode not in ['normal', 'bypass']: self.bridge.get_participant(to).say_on_xmpp_to(self.nickname, 'XIB error: Sorry but cross-protocol private messages are disabled in '+self.bridge.mode+' mode.') else: