From a29a29227a1a2ed1c45797e39495c9e2c26c7bff Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 27 Oct 2018 22:50:41 +0200 Subject: XEP-0363: Add a domain argument to discover an upload service on a specific domain. --- slixmpp/plugins/xep_0363/http_upload.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'slixmpp/plugins') 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() -- cgit v1.2.3