diff --git a/main.py b/main.py index eab1e41..4e18f7b 100644 --- a/main.py +++ b/main.py @@ -432,6 +432,10 @@ def room_close_cb(data, buffer): @utf8_decode def matrix_unload_cb(): matrix_config_free(matrix.globals.CONFIG) + + for server in SERVERS.values(): + server.store_olm() + W.prnt("", "unloading") return W.WEECHAT_RC_OK diff --git a/matrix/encryption.py b/matrix/encryption.py index aced6ac..23e4156 100644 --- a/matrix/encryption.py +++ b/matrix/encryption.py @@ -199,3 +199,7 @@ class Olm(): )) return signature + + @encrypt_enabled + def mark_keys_as_published(self): + self.account.mark_keys_as_published() diff --git a/matrix/events.py b/matrix/events.py index fb6932c..8cfdf06 100644 --- a/matrix/events.py +++ b/matrix/events.py @@ -74,6 +74,9 @@ class MatrixKeyUploadEvent(MatrixEvent): MatrixEvent.__init__(self, server) def execute(self): + self.server.olm.mark_keys_as_published() + self.server.store_olm() + if not self.device_keys: return