[Telepathy-commits] [telepathy-python/master] file-transfer.py: delay file offer

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Dec 10 04:09:17 PST 2008


---
 examples/file-transfer.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/examples/file-transfer.py b/examples/file-transfer.py
index d3636fa..997b272 100644
--- a/examples/file-transfer.py
+++ b/examples/file-transfer.py
@@ -6,6 +6,7 @@ import socket
 import os
 import sys
 import fcntl
+import time
 
 from dbus import PROPERTIES_IFACE
 from telepathy.client import (Connection, Channel)
@@ -166,6 +167,10 @@ class FTSenderClient(FTClient):
     def ready_cb(self, conn):
         FTClient.ready_cb(self, conn)
 
+        # Wait a bit so the other side is aware about us. If he's not,
+        # he'll automatically reject the XMPP connection.
+        time.sleep(3)
+
         handle = self.conn.RequestHandles(CONNECTION_HANDLE_TYPE_CONTACT, [self.contact])[0]
 
         file_name = os.path.basename(self.file_to_offer)
-- 
1.5.6.5



More information about the Telepathy-commits mailing list