Add timeout_callback to a bunch of plugins as a parameter

This commit is contained in:
mathieui
2015-09-04 01:05:56 +02:00
parent 804b23d390
commit 00a0698720
10 changed files with 80 additions and 48 deletions

View File

@@ -62,7 +62,7 @@ class XEP_0054(BasePlugin):
@future_wrapper
def get_vcard(self, jid=None, ifrom=None, local=None, cached=False,
callback=None, timeout=None):
callback=None, timeout=None, timeout_callback=None):
if local is None:
if jid is not None and not isinstance(jid, JID):
jid = JID(jid)
@@ -101,11 +101,12 @@ class XEP_0054(BasePlugin):
iq['type'] = 'get'
iq.enable('vcard_temp')
return iq.send(callback=callback, timeout=timeout)
return iq.send(callback=callback, timeout=timeout,
timeout_callback=timeout_callback)
@future_wrapper
def publish_vcard(self, vcard=None, jid=None, ifrom=None,
callback=None, timeout=None):
callback=None, timeout=None, timeout_callback=None):
self.api['set_vcard'](jid, None, ifrom, vcard)
if self.xmpp.is_component:
return
@@ -115,7 +116,8 @@ class XEP_0054(BasePlugin):
iq['from'] = ifrom
iq['type'] = 'set'
iq.append(vcard)
return iq.send(callback=callback, timeout=timeout)
return iq.send(callback=callback, timeout=timeout,
timeout_callback=timeout_callback)
def _handle_get_vcard(self, iq):
if iq['type'] == 'result':