core, bridge: actionsGet:
- added a new mechanism to keep actions until they are answered (or timeout-ed)
- keep_id must be explicitly used on actionNew
- actionsGet is used to retrive these actions
- the mechanism is used in deferXMLUI
This commit is contained in:
parent
c0b1f1a86e
commit
a42452ff57
1 changed files with 63 additions and 7 deletions
|
|
@ -123,6 +123,20 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
|
||||
return getPluginMethod
|
||||
|
||||
def actionsGet(self, profile_key="@DEFAULT@", callback=None, errback=None):
|
||||
if callback is None:
|
||||
error_handler = None
|
||||
else:
|
||||
if errback is None:
|
||||
errback = log.error
|
||||
error_handler = lambda err:errback(dbus_to_bridge_exception(err))
|
||||
kwargs={}
|
||||
if callback is not None:
|
||||
kwargs['timeout'] = const_TIMEOUT
|
||||
kwargs['reply_handler'] = callback
|
||||
kwargs['error_handler'] = error_handler
|
||||
return self.db_core_iface.actionsGet(profile_key, **kwargs)
|
||||
|
||||
def addContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
|
||||
if callback is None:
|
||||
error_handler = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue