Mercurial > libervia-backend
comparison sat/core/sat_main.py @ 3226:2f406b762788
core (memory/encryption): encryption session are now restored on client connection
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 22 Mar 2020 18:39:12 +0100 |
parents | 4fbea7f1e012 |
children | b0c57c9a4bd8 |
comparison
equal
deleted
inserted
replaced
3225:843a9279fb5a | 3226:2f406b762788 |
---|---|
847 | 847 |
848 def _messageEncryptionStart(self, to_jid_s, namespace, replace=False, | 848 def _messageEncryptionStart(self, to_jid_s, namespace, replace=False, |
849 profile_key=C.PROF_KEY_NONE): | 849 profile_key=C.PROF_KEY_NONE): |
850 client = self.getClient(profile_key) | 850 client = self.getClient(profile_key) |
851 to_jid = jid.JID(to_jid_s) | 851 to_jid = jid.JID(to_jid_s) |
852 return client.encryption.start(to_jid, namespace or None, replace) | 852 return defer.ensureDeferred( |
853 client.encryption.start(to_jid, namespace or None, replace)) | |
853 | 854 |
854 def _messageEncryptionStop(self, to_jid_s, profile_key=C.PROF_KEY_NONE): | 855 def _messageEncryptionStop(self, to_jid_s, profile_key=C.PROF_KEY_NONE): |
855 client = self.getClient(profile_key) | 856 client = self.getClient(profile_key) |
856 to_jid = jid.JID(to_jid_s) | 857 to_jid = jid.JID(to_jid_s) |
857 return client.encryption.stop(to_jid) | 858 return defer.ensureDeferred( |
859 client.encryption.stop(to_jid)) | |
858 | 860 |
859 def _messageEncryptionGet(self, to_jid_s, profile_key=C.PROF_KEY_NONE): | 861 def _messageEncryptionGet(self, to_jid_s, profile_key=C.PROF_KEY_NONE): |
860 client = self.getClient(profile_key) | 862 client = self.getClient(profile_key) |
861 to_jid = jid.JID(to_jid_s) | 863 to_jid = jid.JID(to_jid_s) |
862 session_data = client.encryption.getSession(to_jid) | 864 session_data = client.encryption.getSession(to_jid) |