core: use serialised dict for extra in messageNew and historyGet
This commit is contained in:
parent
13a4177c08
commit
6a7d247754
1 changed files with 33 additions and 19 deletions
|
|
@ -590,10 +590,19 @@ class Memory(object):
|
|||
def addToHistory(self, client, data):
|
||||
return self.storage.addToHistory(data, client.profile)
|
||||
|
||||
def _historyGetSerialise(self, history_data):
|
||||
return [
|
||||
(uid, timestamp, from_jid, to_jid, message, subject, mess_type,
|
||||
data_format.serialise(extra)) for uid, timestamp, from_jid, to_jid, message,
|
||||
subject, mess_type, extra in history_data
|
||||
]
|
||||
|
||||
def _historyGet(self, from_jid_s, to_jid_s, limit=C.HISTORY_LIMIT_NONE, between=True,
|
||||
filters=None, profile=C.PROF_KEY_NONE):
|
||||
return self.historyGet(jid.JID(from_jid_s), jid.JID(to_jid_s), limit, between,
|
||||
d = self.historyGet(jid.JID(from_jid_s), jid.JID(to_jid_s), limit, between,
|
||||
filters, profile)
|
||||
d.addCallback(self._historyGetSerialise)
|
||||
return d
|
||||
|
||||
def historyGet(self, from_jid, to_jid, limit=C.HISTORY_LIMIT_NONE, between=True,
|
||||
filters=None, profile=C.PROF_KEY_NONE):
|
||||
|
|
|
|||
Loading…
Reference in a new issue