From c753082d77ce6e583274133137bdaf0dc564000a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Wed, 13 Apr 2016 14:20:01 +0300 Subject: [PATCH] file transfer fixed --- opt/ahenk/base/messaging/FileTransfer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opt/ahenk/base/messaging/FileTransfer.py b/opt/ahenk/base/messaging/FileTransfer.py index e3f4bfa..901b065 100644 --- a/opt/ahenk/base/messaging/FileTransfer.py +++ b/opt/ahenk/base/messaging/FileTransfer.py @@ -13,7 +13,9 @@ from base.Scope import Scope class FileTransfer(slixmpp.ClientXMPP): def __init__(self, file_path): - print('init') + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + scope = Scope().getInstance() self.logger = scope.getLogger() @@ -24,7 +26,10 @@ class FileTransfer(slixmpp.ClientXMPP): self.my_pass = str(self.configuration_manager.get('CONNECTION', 'password')) self.receiver = self.configuration_manager.get('CONNECTION', 'receiverjid') + '@' + self.configuration_manager.get('CONNECTION', 'servicename') + '/Smack' - slixmpp.ClientXMPP.__init__(self, self.my_jid, self.my_pass) + try: + slixmpp.ClientXMPP.__init__(self, self.my_jid, self.my_pass) + except Exception as e: + print(str(e)) self.register_plugin('xep_0030') # Service Discovery self.register_plugin('xep_0065')