From c5550bdbc82e5dd359c08518f2200e57927d0ec1 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 2 Feb 2022 20:09:28 +0100 Subject: [PATCH] events: Fix missing condition in Unsigned::is_empty under unstable-pre-spec --- crates/ruma-events/src/unsigned.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ruma-events/src/unsigned.rs b/crates/ruma-events/src/unsigned.rs index 4622149d..2f43a3dd 100644 --- a/crates/ruma-events/src/unsigned.rs +++ b/crates/ruma-events/src/unsigned.rs @@ -41,7 +41,15 @@ impl Unsigned { /// events. Do not use it to determine whether an incoming `unsigned` field was present - it /// could still have been present but contained none of the known fields. pub fn is_empty(&self) -> bool { - self.age.is_none() && self.transaction_id.is_none() + #[cfg(not(feature = "unstable-pre-spec"))] + { + self.age.is_none() && self.transaction_id.is_none() + } + + #[cfg(feature = "unstable-pre-spec")] + { + self.age.is_none() && self.transaction_id.is_none() && self.relations.is_none() + } } }