Fix some more blocking iq
This commit is contained in:
parent
fa21e262c7
commit
07e46837d9
@ -188,9 +188,6 @@ class ClientXMPP(BaseXMPP):
|
|||||||
``'none'``. If set to ``'remove'``,
|
``'none'``. If set to ``'remove'``,
|
||||||
the entry will be deleted.
|
the entry will be deleted.
|
||||||
:param groups: The roster groups that contain this item.
|
:param groups: The roster groups that contain this item.
|
||||||
:param block: Specify if the roster request will block
|
|
||||||
until a response is received, or a timeout
|
|
||||||
occurs. Defaults to ``True``.
|
|
||||||
:param timeout: The length of time (in seconds) to wait
|
:param timeout: The length of time (in seconds) to wait
|
||||||
for a response before continuing if blocking
|
for a response before continuing if blocking
|
||||||
is used. Defaults to
|
is used. Defaults to
|
||||||
@ -205,12 +202,11 @@ class ClientXMPP(BaseXMPP):
|
|||||||
subscription = kwargs.get('subscription', current['subscription'])
|
subscription = kwargs.get('subscription', current['subscription'])
|
||||||
groups = kwargs.get('groups', current['groups'])
|
groups = kwargs.get('groups', current['groups'])
|
||||||
|
|
||||||
block = kwargs.get('block', True)
|
|
||||||
timeout = kwargs.get('timeout', None)
|
timeout = kwargs.get('timeout', None)
|
||||||
callback = kwargs.get('callback', None)
|
callback = kwargs.get('callback', None)
|
||||||
|
|
||||||
return self.client_roster.update(jid, name, subscription, groups,
|
return self.client_roster.update(jid, name, subscription, groups,
|
||||||
block, timeout, callback)
|
timeout, callback)
|
||||||
|
|
||||||
def del_roster_item(self, jid):
|
def del_roster_item(self, jid):
|
||||||
"""Remove an item from the roster.
|
"""Remove an item from the roster.
|
||||||
|
@ -66,16 +66,20 @@ class XEP_0280(BasePlugin):
|
|||||||
def _handle_carbon_sent(self, msg):
|
def _handle_carbon_sent(self, msg):
|
||||||
self.xmpp.event('carbon_sent', msg)
|
self.xmpp.event('carbon_sent', msg)
|
||||||
|
|
||||||
def enable(self, ifrom=None, block=True, timeout=None, callback=None):
|
def enable(self, ifrom=None, timeout=None, callback=None,
|
||||||
|
timeout_callback=None):
|
||||||
iq = self.xmpp.Iq()
|
iq = self.xmpp.Iq()
|
||||||
iq['type'] = 'set'
|
iq['type'] = 'set'
|
||||||
iq['from'] = ifrom
|
iq['from'] = ifrom
|
||||||
iq.enable('carbon_enable')
|
iq.enable('carbon_enable')
|
||||||
return iq.send(block=block, timeout=timeout, callback=callback)
|
return iq.send(timeout_callback=timeout_callback, timeout=timeout,
|
||||||
|
callback=callback)
|
||||||
|
|
||||||
def disable(self, ifrom=None, block=True, timeout=None, callback=None):
|
def disable(self, ifrom=None, timeout=None, callback=None,
|
||||||
|
timeout_callback=None):
|
||||||
iq = self.xmpp.Iq()
|
iq = self.xmpp.Iq()
|
||||||
iq['type'] = 'set'
|
iq['type'] = 'set'
|
||||||
iq['from'] = ifrom
|
iq['from'] = ifrom
|
||||||
iq.enable('carbon_disable')
|
iq.enable('carbon_disable')
|
||||||
return iq.send(block=block, timeout=timeout, callback=callback)
|
return iq.send(timeout_callback=timeout_callback, timeout=timeout,
|
||||||
|
callback=callback)
|
||||||
|
@ -238,7 +238,7 @@ class RosterNode(object):
|
|||||||
return self.update(jid, subscription='remove')
|
return self.update(jid, subscription='remove')
|
||||||
|
|
||||||
def update(self, jid, name=None, subscription=None, groups=[],
|
def update(self, jid, name=None, subscription=None, groups=[],
|
||||||
block=True, timeout=None, callback=None):
|
timeout=None, callback=None, timeout_callback=None):
|
||||||
"""
|
"""
|
||||||
Update a JID's subscription information.
|
Update a JID's subscription information.
|
||||||
|
|
||||||
@ -248,15 +248,11 @@ class RosterNode(object):
|
|||||||
subscription -- The subscription state. May be one of: 'to',
|
subscription -- The subscription state. May be one of: 'to',
|
||||||
'from', 'both', 'none', or 'remove'.
|
'from', 'both', 'none', or 'remove'.
|
||||||
groups -- A list of group names.
|
groups -- A list of group names.
|
||||||
block -- Specify if the roster request will block
|
|
||||||
until a response is received, or a timeout
|
|
||||||
occurs. Defaults to True.
|
|
||||||
timeout -- The length of time (in seconds) to wait
|
timeout -- The length of time (in seconds) to wait
|
||||||
for a response before continuing if blocking
|
for a response before continuing if blocking
|
||||||
is used. Defaults to self.response_timeout.
|
is used. Defaults to self.response_timeout.
|
||||||
callback -- Optional reference to a stream handler function.
|
callback -- Optional reference to a stream handler function.
|
||||||
Will be executed when the roster is received.
|
Will be executed when the roster is received.
|
||||||
Implies block=False.
|
|
||||||
"""
|
"""
|
||||||
self[jid]['name'] = name
|
self[jid]['name'] = name
|
||||||
self[jid]['groups'] = groups
|
self[jid]['groups'] = groups
|
||||||
@ -269,7 +265,8 @@ class RosterNode(object):
|
|||||||
'subscription': subscription,
|
'subscription': subscription,
|
||||||
'groups': groups}}
|
'groups': groups}}
|
||||||
|
|
||||||
return iq.send(block, timeout, callback)
|
return iq.send(timeout=timeout, callback=callback,
|
||||||
|
timeout_callback=timeout_callback)
|
||||||
|
|
||||||
def presence(self, jid, resource=None):
|
def presence(self, jid, resource=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user