mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-12-25 03:00:17 +00:00
1d22a04721
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') |
||
---|---|---|
.. | ||
__init__.py | ||
oob.py | ||
stanza.py |