diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-10-27 22:50:41 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-10-27 22:51:04 +0200 |
commit | a29a29227a1a2ed1c45797e39495c9e2c26c7bff (patch) | |
tree | 3527bde723174351eb18492fc240d3a6787349bf | |
parent | d4d542b7411c9f2d099d17bae0acfe327318442c (diff) | |
download | slixmpp-a29a29227a1a2ed1c45797e39495c9e2c26c7bff.tar.gz slixmpp-a29a29227a1a2ed1c45797e39495c9e2c26c7bff.tar.bz2 slixmpp-a29a29227a1a2ed1c45797e39495c9e2c26c7bff.tar.xz slixmpp-a29a29227a1a2ed1c45797e39495c9e2c26c7bff.zip |
XEP-0363: Add a domain argument to discover an upload service on a specific domain.
-rw-r--r-- | slixmpp/plugins/xep_0363/http_upload.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py index 50cdc5a9..b39757ae 100644 --- a/slixmpp/plugins/xep_0363/http_upload.py +++ b/slixmpp/plugins/xep_0363/http_upload.py @@ -67,8 +67,9 @@ class XEP_0363(BasePlugin): def _handle_request(self, iq): self.xmpp.event('http_upload_request', iq) - async def find_upload_service(self, timeout=None, timeout_callback=None): + async def find_upload_service(self, domain=None, timeout=None, timeout_callback=None): results = await self.xmpp['xep_0030'].get_info_from_domain( + domain=domain, timeout=timeout, timeout_callback=timeout_callback) for info in results: @@ -90,11 +91,12 @@ class XEP_0363(BasePlugin): timeout_callback=timeout_callback) async def upload_file(self, filename, size=None, content_type=None, *, - input_file=None, ifrom=None, timeout=None, + input_file=None, ifrom=None, domain=None, timeout=None, callback=None, timeout_callback=None): ''' Helper function which does all of the uploading process. ''' if self.upload_service is None: info_iq = await self.find_upload_service( + domain=domain, timeout=timeout, timeout_callback=timeout_callback) if info_iq is None: raise UploadServiceNotFound() |