diff options
author | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-06-10 05:31:26 +0000 |
---|---|---|
committer | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-06-10 05:31:26 +0000 |
commit | 7279c2ba6e9ad29a8e635c21d5549b21d7b8c461 (patch) | |
tree | 7664877372ac8cb3e145d8cc9eb429bbf5420aeb /proxy.py | |
parent | 39c6f9c39789e3941575e55e30c401d3c51657b4 (diff) | |
download | omegle-7279c2ba6e9ad29a8e635c21d5549b21d7b8c461.tar.gz omegle-7279c2ba6e9ad29a8e635c21d5549b21d7b8c461.zip |
idlecount
git-svn-id: http://xapek.org/svn/common/omegle@1097 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'proxy.py')
-rw-r--r-- | proxy.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) |