From 47fae308e03ed7360c897a0a8ccf0bd0fca88263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Tue, 15 May 2018 23:24:14 +0200 Subject: [PATCH] encryption: Send to device messages to every device of a user. --- matrix/encryption.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/matrix/encryption.py b/matrix/encryption.py index ea731d0..d5f6e08 100644 --- a/matrix/encryption.py +++ b/matrix/encryption.py @@ -409,9 +409,10 @@ class Olm(): } } - to_device_dict["messages"][user] = { - key.device_id: olm_dict - } + if user not in to_device_dict["messages"]: + to_device_dict["messages"][user] = {} + + to_device_dict["messages"][user][key.device_id] = olm_dict return to_device_dict