summaryrefslogtreecommitdiff
path: root/tests/test_stream_xep_0030.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-07-05 09:22:17 -0700
committerLance Stout <lancestout@gmail.com>2011-07-05 09:22:17 -0700
commit1d22a0472193a543129875ac9a412de4d11fb8b0 (patch)
treef3b5dbe89df9cb9140780ca57a1d62ea3245414b /tests/test_stream_xep_0030.py
parent5efb170e1d7d210304d5bc31f343743770d82e13 (diff)
downloadslixmpp-1d22a0472193a543129875ac9a412de4d11fb8b0.tar.gz
slixmpp-1d22a0472193a543129875ac9a412de4d11fb8b0.tar.bz2
slixmpp-1d22a0472193a543129875ac9a412de4d11fb8b0.tar.xz
slixmpp-1d22a0472193a543129875ac9a412de4d11fb8b0.zip
Added support for custom OOB transfer handlers.
Accepting download requests can be done using: self['xep_0066'].register_url_handler(handler=self.oob_download) # Add jid=... to specify a handler for a particular JID for a # componenent. def oob_download(self, iq): if iq['from'] not in self.custom_oob_whitelist: raise XMPPError('not-authorized') try: data = urllib2.urlopen(iq['oob_transfer']['url']) file = open('oob_download', 'w+') file.write(data.read()) file.close() data.close() except: raise XMPPError('item-not-found')
Diffstat (limited to 'tests/test_stream_xep_0030.py')
0 files changed, 0 insertions, 0 deletions