comparison sat/core/sat_main.py @ 3179:84a94b385760

bridge: messageSend's extra is now serialised
author Goffi <goffi@goffi.org>
date Fri, 21 Feb 2020 12:17:38 +0100
parents d10b2368684e
children 439e2f88c3a9
comparison
equal deleted inserted replaced
3178:98b321234068 3179:84a94b385760
781 d.addCallback(lambda xmlui: xmlui.toXml()) 781 d.addCallback(lambda xmlui: xmlui.toXml())
782 return d 782 return d
783 783
784 ## XMPP methods ## 784 ## XMPP methods ##
785 785
786 def _messageSend(self, to_jid_s, message, subject=None, mess_type="auto", extra=None, 786 def _messageSend(
787 profile_key=C.PROF_KEY_NONE,): 787 self, to_jid_s, message, subject=None, mess_type="auto", extra_s="",
788 profile_key=C.PROF_KEY_NONE):
788 client = self.getClient(profile_key) 789 client = self.getClient(profile_key)
789 to_jid = jid.JID(to_jid_s) 790 to_jid = jid.JID(to_jid_s)
790 # XXX: we need to use the dictionary comprehension because D-Bus return its own
791 # types, and pickle can't manage them. TODO: Need to find a better way
792 return client.sendMessage( 791 return client.sendMessage(
793 to_jid, 792 to_jid,
794 message, 793 message,
795 subject, 794 subject,
796 mess_type, 795 mess_type,
797 {str(key): str(value) for key, value in list(extra.items())}, 796 data_format.deserialise(extra_s)
798 ) 797 )
799 798
800 def _setPresence(self, to="", show="", statuses=None, profile_key=C.PROF_KEY_NONE): 799 def _setPresence(self, to="", show="", statuses=None, profile_key=C.PROF_KEY_NONE):
801 return self.setPresence(jid.JID(to) if to else None, show, statuses, profile_key) 800 return self.setPresence(jid.JID(to) if to else None, show, statuses, profile_key)
802 801