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 --- omegle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'omegle.py') diff --git a/omegle.py b/omegle.py index 4f5e327..422c587 100644 --- a/omegle.py +++ b/omegle.py @@ -155,7 +155,7 @@ class OmegleChat(RESTClient): try: data_set=json.read(body.decode("utf8")) if not data_set: - self.logger.debug("event: no data received") + self.on_idle() return for data in data_set: if data[0] == "typing": @@ -179,6 +179,8 @@ class OmegleChat(RESTClient): except json.ReadException: self.logger.error("Json ReadException. Body: %s" % body) + def on_idle(self): + self.logger.debug("event: no data received") def on_message(self,message): """To be overwritten""" self.logger.info("<<< %s" % message) -- cgit v1.2.1