From 7279c2ba6e9ad29a8e635c21d5549b21d7b8c461 Mon Sep 17 00:00:00 2001 From: yvesf Date: Wed, 10 Jun 2009 05:31:26 +0000 Subject: idlecount git-svn-id: http://xapek.org/svn/common/omegle@1097 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd --- proxy.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'proxy.py') diff --git a/proxy.py b/proxy.py index 2d5fb60..efb4a90 100644 --- a/proxy.py +++ b/proxy.py @@ -15,6 +15,7 @@ class OmegleProxyChat(OmegleChat): self.disconnect_event = disconnect_event self.name = name self.color = color + self.idlecount = 0 def c(self,str,bold=False): if bold: @@ -25,7 +26,16 @@ class OmegleProxyChat(OmegleChat): def set_partner(self,partner): self.partner = partner + def on_idle(self): + self.idlecount += 1 + if self.idlecount > 8: + self.logger.info("Idle > 8. disconnect()") + self.disconnect() + else: + self.logger.info("Idle count %s/8" % self.idlecount) + def on_message(self,message): + self.idlecount = 0 print self.c("%s [MSG] %s: %s" %(time.strftime("%H:%M:%S"), self.name, message),bold=True) if self.partner.is_connected: self.partner.send(message) -- cgit v1.2.1