aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Crama <pcfeb0009@gmx.com>2010-12-28 14:06:16 +0100
committerPhilippe Crama <pcfeb0009@gmx.com>2010-12-28 14:06:16 +0100
commitf85837a655ba1ba169e272e5929242b1bd47f51f (patch)
tree7046650877141fc50c1556c91b78791c69fe9a85
parent1130561aa6092404f6f08735d3de8c22f120dee9 (diff)
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.
-rw-r--r--skype/skyped.py5
1 files changed, 4 insertions, 1 deletions
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: