summaryrefslogtreecommitdiff
path: root/proxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'proxy.py')
-rw-r--r--proxy.py10
1 files changed, 10 insertions, 0 deletions
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)