olm: Mark one time keys as published and store the account.

This commit is contained in:
poljar (Damir Jelić) 2018-03-25 22:01:34 +02:00
parent d28e6eb598
commit f8c1f564ae
3 changed files with 11 additions and 0 deletions

View file

@ -432,6 +432,10 @@ def room_close_cb(data, buffer):
@utf8_decode @utf8_decode
def matrix_unload_cb(): def matrix_unload_cb():
matrix_config_free(matrix.globals.CONFIG) matrix_config_free(matrix.globals.CONFIG)
for server in SERVERS.values():
server.store_olm()
W.prnt("", "unloading") W.prnt("", "unloading")
return W.WEECHAT_RC_OK return W.WEECHAT_RC_OK

View file

@ -199,3 +199,7 @@ class Olm():
)) ))
return signature return signature
@encrypt_enabled
def mark_keys_as_published(self):
self.account.mark_keys_as_published()

View file

@ -74,6 +74,9 @@ class MatrixKeyUploadEvent(MatrixEvent):
MatrixEvent.__init__(self, server) MatrixEvent.__init__(self, server)
def execute(self): def execute(self):
self.server.olm.mark_keys_as_published()
self.server.store_olm()
if not self.device_keys: if not self.device_keys:
return return