encryption: Fix account loading for python3.
This commit is contained in:
parent
86ae77c38c
commit
5c6389fc47
1 changed files with 20 additions and 4 deletions
|
@ -759,15 +759,31 @@ class Olm():
|
||||||
inbound_group_sessions = defaultdict(dict)
|
inbound_group_sessions = defaultdict(dict)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
account = Account.from_pickle(bytes(account_pickle, "utf-8"))
|
try:
|
||||||
|
account_pickle = bytes(account_pickle, "utf-8")
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
account = Account.from_pickle(account_pickle)
|
||||||
|
|
||||||
for db_session in db_sessions:
|
for db_session in db_sessions:
|
||||||
|
session_pickle = db_session[2]
|
||||||
|
try:
|
||||||
|
session_pickle = bytes(session_pickle, "utf-8")
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
sessions[db_session[0]][db_session[1]].append(
|
sessions[db_session[0]][db_session[1]].append(
|
||||||
Session.from_pickle(bytes(db_session[2], "utf-8")))
|
Session.from_pickle(session_pickle))
|
||||||
|
|
||||||
for db_session in db_inbound_group_sessions:
|
for db_session in db_inbound_group_sessions:
|
||||||
session = InboundGroupSession.from_pickle(
|
session_pickle = db_session[1]
|
||||||
bytes(db_session[1], "utf-8"))
|
try:
|
||||||
|
session_pickle = bytes(session_pickle, "utf-8")
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
session = InboundGroupSession.from_pickle(session_pickle)
|
||||||
inbound_group_sessions[db_session[0]][session.id] = session
|
inbound_group_sessions[db_session[0]][session.id] = session
|
||||||
|
|
||||||
return cls(user, device_id, session_path, database, account,
|
return cls(user, device_id, session_path, database, account,
|
||||||
|
|
Loading…
Reference in a new issue