memory (sqlite): the result of pickle.dumps in addToHistory must be encoded for the special characters to be stored.
This commit is contained in:
parent
63bf55d69f
commit
e63752db76
1 changed files with 2 additions and 1 deletions
|
|
@ -190,9 +190,10 @@ class SqliteStorage(object):
|
|||
assert(profile)
|
||||
if extra is None:
|
||||
extra = {}
|
||||
extra_ = pickle.dumps({k: v.encode('utf-8') for k, v in extra.items()}, 0).decode('utf-8')
|
||||
d = self.dbpool.runQuery("INSERT INTO history(source, source_res, dest, dest_res, timestamp, message, type, extra, profile_id) VALUES (?,?,?,?,?,?,?,?,?)",
|
||||
(from_jid.userhost(), from_jid.resource, to_jid.userhost(), to_jid.resource, timestamp or time(),
|
||||
message, _type, pickle.dumps(extra, 0), self.profiles[profile]))
|
||||
message, _type, extra_, self.profiles[profile]))
|
||||
d.addErrback(lambda ignore: error(_("Can't save following message in history: from [%(from_jid)s] to [%(to_jid)s] ==> [%(message)s]" %
|
||||
{"from_jid": from_jid.full(), "to_jid": to_jid.full(), "message": message})))
|
||||
return d
|
||||
|
|
|
|||
Loading…
Reference in a new issue