From f85837a655ba1ba169e272e5929242b1bd47f51f Mon Sep 17 00:00:00 2001 From: Philippe Crama Date: Tue, 28 Dec 2010 14:06:16 +0100 Subject: Close connection when going offline When the user disconnects from bitlbee (either by quitting or by logging out "account skype off"), skyped should close its connection and wait for a new connection. This change is useful to make the test cases pass as otherwise, skyped would not notice that the first test was done and that the second test was trying to connect, thus leading to a failure in the second test. --- skype/skyped.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skype/skyped.py b/skype/skyped.py index 247316f2..bf35b9ce 100644 --- a/skype/skyped.py +++ b/skype/skyped.py @@ -77,6 +77,7 @@ def input_handler(fd): options.buf = None return True else: + close_socket = False if wait_for_lock(options.lock, 3, 10, "input_handler"): try: input = fd.recv(1024) @@ -88,8 +89,10 @@ def input_handler(fd): options.lock.release() return False for i in input.split("\n"): + if i.strip() == "SET USERSTATUS OFFLINE": + close_socket = True skype.send(i.strip()) - return True + return not(close_socket) def skype_idle_handler(skype): try: -- cgit v1.2.3