diff options
Diffstat (limited to 'icq_roombot.py')
-rw-r--r-- | icq_roombot.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/icq_roombot.py b/icq_roombot.py index 7dc3da9..835d639 100644 --- a/icq_roombot.py +++ b/icq_roombot.py @@ -186,15 +186,20 @@ class ReconnectingOSCARFactory(protocol.ClientFactory): return p def clientConnectionLost(self, connector, reason): + print "reconnect in %s" % self.delay reactor.callLater(self.delay, self._reconnect) def _reconnect(self): + print "reconnect" f = ReconnectingOSCARLoginFactory(uin, password) return reactor.connectTCP(host, port, f) class OscarCrap( oscar.OscarAuthenticator ): BOSClass = icqBot connectfactory = ReconnectingOSCARFactory + def connectToBOS(self, server, port): + f = self.connectfactory(self.username, self.cookie) + return reactor.connectTCP(server, int(port), f) class ReconnectingOSCARLoginFactory(protocol.ReconnectingClientFactory): protocol = OscarCrap @@ -214,4 +219,3 @@ if __name__ == '__main__': f = ReconnectingOSCARLoginFactory(uin, password) reactor.connectTCP(host, port, f) reactor.run() - |