bridge, memory: add "search" attribute to getHistory (filter the results with a unix globbing pattern)

This commit is contained in:
souliane 2014-10-04 10:25:32 +02:00
commit 767f3d50dc
2 changed files with 22 additions and 13 deletions

View file

@ -277,10 +277,10 @@ class DbusObject(dbus.service.Object):
return self._callback("getEntityData", unicode(jid), keys, unicode(profile))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ssibs', out_signature='a(dssssa{ss})',
in_signature='ssibss', out_signature='a(dssssa{ss})',
async_callbacks=('callback', 'errback'))
def getHistory(self, from_jid, to_jid, limit, between=True, profile="@NONE@", callback=None, errback=None):
return self._callback("getHistory", unicode(from_jid), unicode(to_jid), limit, between, unicode(profile), callback=callback, errback=errback)
def getHistory(self, from_jid, to_jid, limit, between=True, search='', profile="@NONE@", callback=None, errback=None):
return self._callback("getHistory", unicode(from_jid), unicode(to_jid), limit, between, unicode(search), unicode(profile), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ss', out_signature='s',

View file

@ -483,16 +483,18 @@ doc_param_2=app: name of the frontend registering the parameters
async=
type=method
category=core
sig_in=ssibs
sig_in=ssibss
sig_out=a(dssssa{ss})
param_3_default=True
param_4_default="@NONE@"
param_4_default=''
param_5_default="@NONE@"
doc=Get history of a communication between two entities
doc_param_0=from_jid: source JID (bare jid for catch all, full jid else)
doc_param_1=to_jid: dest JID (bare jid for catch all, full jid else)
doc_param_2=limit: max number of history elements to get (0 for the whole history)
doc_param_3=between: True if we want history between the two jids (in both direction), False if we only want messages from from_jid to to_jid
doc_param_4=%(doc_profile)s
doc_param_4=search: pattern to filter the history results
doc_param_5=%(doc_profile)s
doc_return=Ordered list (by timestamp) of tuples (timestamp, full from_jid, full to_jid, message, type, extra)
[addContact]