diff sat/core/xmpp.py @ 3170:39d7327583e1

core: use serialised dict for `extra` in messageNew and historyGet
author Goffi <goffi@goffi.org>
date Tue, 18 Feb 2020 18:13:17 +0100
parents b5c058c7692e
children dcebc585c29f
line wrap: on
line diff
--- a/sat/core/xmpp.py	Fri Feb 14 15:18:52 2020 +0100
+++ b/sat/core/xmpp.py	Tue Feb 18 18:13:17 2020 +0100
@@ -1,7 +1,6 @@
 #!/usr/bin/env python3
 
-
-# SAT: a jabber client
+# SàT: a XMPP client
 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
 
 # This program is free software: you can redistribute it and/or modify
@@ -42,6 +41,7 @@
 from sat.memory import encryption
 from sat.memory import persistent
 from sat.tools import xml_tools
+from sat.tools.common import data_format
 from zope.interface import implementer
 
 log = getLogger(__name__)
@@ -677,7 +677,7 @@
         """Generate args to use with bridge from data dict"""
         return (data["uid"], data["timestamp"], data["from"].full(),
                 data["to"].full(), data["message"], data["subject"],
-                data["type"], data["extra"])
+                data["type"], data_format.serialise(data["extra"]))
 
 
     def messageSendToBridge(self, data):
@@ -860,7 +860,7 @@
             message={"": message},
             subject={},
             mess_type=C.MESS_TYPE_INFO,
-            extra=extra,
+            extra=data_format.serialise(extra),
             profile=self.profile,
         )
 
@@ -1147,7 +1147,7 @@
                     data["message"],
                     data["subject"],
                     data["type"],
-                    data["extra"],
+                    data_format.serialise(data["extra"]),
                     profile=self.parent.profile,
                 )
             else: