encryption: Update for some olm lib API changes.
This commit is contained in:
parent
87a8c1a5c0
commit
86ae77c38c
2 changed files with 13 additions and 9 deletions
|
@ -39,10 +39,14 @@ except NameError:
|
|||
import matrix.globals
|
||||
|
||||
try:
|
||||
from olm.account import Account, OlmAccountError
|
||||
from olm.session import (Session, InboundSession, OutboundSession,
|
||||
OlmSessionError, OlmPreKeyMessage)
|
||||
from olm.group_session import (
|
||||
from olm import (
|
||||
Account,
|
||||
OlmAccountError,
|
||||
Session,
|
||||
InboundSession,
|
||||
OutboundSession,
|
||||
OlmSessionError,
|
||||
OlmPreKeyMessage,
|
||||
InboundGroupSession,
|
||||
OutboundGroupSession,
|
||||
OlmGroupSessionError
|
||||
|
@ -787,7 +791,7 @@ class Olm():
|
|||
cursor.execute("""update olmsessions set pickle=?
|
||||
where user = ? and session_id = ? and
|
||||
device_id = ?""",
|
||||
(session.pickle(), user, session.id(),
|
||||
(session.pickle(), user, session.id,
|
||||
device_id))
|
||||
self.database.commit()
|
||||
|
||||
|
@ -800,7 +804,7 @@ class Olm():
|
|||
for session in session_dict.values():
|
||||
cursor.execute("""update inbound_group_sessions set pickle=?
|
||||
where room_id = ? and session_id = ?""",
|
||||
(session.pickle(), room_id, session.id()))
|
||||
(session.pickle(), room_id, session.id))
|
||||
self.database.commit()
|
||||
|
||||
cursor.close()
|
||||
|
@ -809,7 +813,7 @@ class Olm():
|
|||
cursor = self.database.cursor()
|
||||
|
||||
cursor.execute("insert into olmsessions values(?,?,?,?)",
|
||||
(user, device_id, session.id(), session.pickle()))
|
||||
(user, device_id, session.id, session.pickle()))
|
||||
|
||||
self.database.commit()
|
||||
|
||||
|
|
|
@ -556,7 +556,7 @@ class MatrixServer:
|
|||
def upload_keys(self, device_keys=False, one_time_keys=False):
|
||||
keys = self.olm.account.identity_keys() if device_keys else None
|
||||
|
||||
one_time_keys = (self.olm.account.one_time_keys()["curve25519"] if
|
||||
one_time_keys = (self.olm.account.one_time_keys["curve25519"] if
|
||||
one_time_keys else None)
|
||||
|
||||
message = MatrixKeyUploadMessage(self.client, self.user_id,
|
||||
|
@ -566,7 +566,7 @@ class MatrixServer:
|
|||
|
||||
@encrypt_enabled
|
||||
def check_one_time_keys(self, key_count):
|
||||
max_keys = self.olm.account.max_one_time_keys()
|
||||
max_keys = self.olm.account.max_one_time_keys
|
||||
|
||||
key_count = (max_keys / 2) - key_count
|
||||
|
||||
|
|
Loading…
Reference in a new issue