From db76c221800d65459b25f7487781fb06cf9d1b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Fri, 7 May 2021 11:34:10 +0200 Subject: [PATCH] events: Add constructor for EncryptedEventContent --- crates/ruma-events/src/room/encrypted.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ruma-events/src/room/encrypted.rs b/crates/ruma-events/src/room/encrypted.rs index bdcb2aa6..4b50d4e7 100644 --- a/crates/ruma-events/src/room/encrypted.rs +++ b/crates/ruma-events/src/room/encrypted.rs @@ -41,6 +41,13 @@ pub struct EncryptedEventContent { pub relates_to: Option, } +impl EncryptedEventContent { + /// Creates a new `EncryptedEventContent` with the given scheme and relation. + pub fn new(scheme: EncryptedEventScheme, relates_to: Option) -> Self { + Self { scheme, relates_to } + } +} + /// The to-device version of the payload for the `EncryptedEvent`. pub type EncryptedToDeviceEventContent = EncryptedEventContent;