bridge, memory: add "search" attribute to getHistory (filter the results with a unix globbing pattern)
This commit is contained in:
parent
7a344fcf5d
commit
767f3d50dc
2 changed files with 22 additions and 13 deletions
|
|
@ -164,8 +164,8 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
def getEntityData(self, jid, keys, profile):
|
||||
return self.db_core_iface.getEntityData(jid, keys, profile)
|
||||
|
||||
def getHistory(self, from_jid, to_jid, limit, between=True, profile="@NONE@", callback=None, errback=None):
|
||||
return self.db_core_iface.getHistory(from_jid, to_jid, limit, between, profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=lambda err:errback(dbus_to_bridge_exception(err)))
|
||||
def getHistory(self, from_jid, to_jid, limit, between=True, search='', profile="@NONE@", callback=None, errback=None):
|
||||
return self.db_core_iface.getHistory(from_jid, to_jid, limit, between, search, profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=lambda err:errback(dbus_to_bridge_exception(err)))
|
||||
|
||||
def getLastResource(self, contact_jid, profile_key="@DEFAULT@"):
|
||||
return unicode(self.db_core_iface.getLastResource(contact_jid, profile_key))
|
||||
|
|
|
|||
|
|
@ -100,9 +100,10 @@ class QuickChat(object):
|
|||
"""Refresh or scroll down the focus after the history is printed"""
|
||||
pass
|
||||
|
||||
def historyPrint(self, size=C.HISTORY_LIMIT_DEFAULT, profile='@NONE@'):
|
||||
def historyPrint(self, size=C.HISTORY_LIMIT_DEFAULT, search='', profile='@NONE@'):
|
||||
"""Print the current history
|
||||
@param size (int): number of messages
|
||||
@param search (str): pattern to filter the history results
|
||||
@param profile (str): %(doc_profile)s
|
||||
"""
|
||||
log.debug(_("now we print the history (%d messages)") % size)
|
||||
|
|
@ -124,7 +125,7 @@ class QuickChat(object):
|
|||
else:
|
||||
target = self.target.bare
|
||||
|
||||
return self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].bare, target, size, profile=profile, callback=onHistory, errback=onHistoryError)
|
||||
return self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].bare, target, size, search=search, profile=profile, callback=onHistory, errback=onHistoryError)
|
||||
|
||||
def _get_nick(self, jid):
|
||||
"""Return nick of this jid when possible"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue