summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Beggs <macdiesel@gmail.com>2010-07-02 02:17:48 +0800
committerThom Nichols <tmnichols@gmail.com>2010-07-02 22:29:08 +0800
commitfe1d3004ccf6ec30296bc9b894ddfa2925f2a27b (patch)
treea0883f9ec6fda580edaad8d65979deedbb7ffdaf
parent62da57a6c26a16024dd481b364e5d1021bc3dd3b (diff)
downloadslixmpp-fe1d3004ccf6ec30296bc9b894ddfa2925f2a27b.tar.gz
slixmpp-fe1d3004ccf6ec30296bc9b894ddfa2925f2a27b.tar.bz2
slixmpp-fe1d3004ccf6ec30296bc9b894ddfa2925f2a27b.tar.xz
slixmpp-fe1d3004ccf6ec30296bc9b894ddfa2925f2a27b.zip
xep_0047 initial module checkin
-rw-r--r--sleekxmpp/plugins/xep_0047.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0047.py b/sleekxmpp/plugins/xep_0047.py
new file mode 100644
index 00000000..beaadcdc
--- /dev/null
+++ b/sleekxmpp/plugins/xep_0047.py
@@ -0,0 +1,52 @@
+'''
+Created on Jul 1, 2010
+
+@author: bbeggs
+'''
+from . import base
+import logging
+import threading
+from xml.etree import cElementTree as ET
+
+class xep_0047(base.base_plugin):
+ '''
+ In-band file transfer for xmpp.
+
+ Both message and iq transfer is supported with message being attempted first.
+ '''
+
+ def plugin_init(self):
+ self.xep = 'xep-047'
+ self.description = 'in-band file transfer'
+ self.acceptTransfers = self.config.get('acceptTransfers', True)
+ self.saveDirectory = self.config.get('saveDirectory', '/tmp')
+ self.stanzaType = self.config.get('stanzaType', 'message')
+ self.maxSendThreads = self.config.get('maxSendThreads', 1)
+ self.maxReceiveThreads = self.config.get('maxReceiveThreads', 1)
+
+ #thread setup
+ self.receiveThreads = {} #id:thread
+ self.sendThreads = {}
+
+ #add handlers to listen for incoming requests
+ self.xmpp.add_handler("<iq><open xmlns='http://jabber.org/protocol/ibb' /></iq>", self._handleIncomingTransferRequest)
+
+ def post_init(self):
+ self.post_inited = True
+
+
+ def sendFile(self, filePath, threaded=True):
+ #TODO use this method to send a file
+ pass
+
+ def _handleIncomingTransferRequest(self, xml):
+ pass
+
+class receiverThread(threading.Thread):
+ def run(self):
+ pass
+
+class senderThread(threading.Thread):
+ def run(self):
+ pass
+