diff options
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) |