From 2b0f4bd192a72f42093344978ea49ccf22b8bea8 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 8 May 2026 15:53:47 +0200 Subject: [PATCH] plugin XEP-0033: Fix validation error when only metadata address are used: XEP-0033 may be used as a simple metadata marker when sending messages (e.g. to indicate a `replyto`). The validation was failing on that due to missing `to`, `cc` and `bcc`. --- libervia/backend/plugins/plugin_xep_0033.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libervia/backend/plugins/plugin_xep_0033.py b/libervia/backend/plugins/plugin_xep_0033.py index 7dd47416..6c3f1061 100644 --- a/libervia/backend/plugins/plugin_xep_0033.py +++ b/libervia/backend/plugins/plugin_xep_0033.py @@ -126,7 +126,9 @@ class AddressesData(BaseModel): @model_validator(mode="after") def check_minimal_data(self) -> Self: - assert self.to or self.cc or self.bcc, "At least one recipent must be set" + has_recipient = self.to or self.cc or self.bcc + has_metadata = self.replyto or self.replyroom or self.noreply or self.ofrom + assert has_recipient or has_metadata, "At least one address field must be set" if self.noreply and (self.replyto is not None or self.replyroom is not None): log.warning( '"noreply" can\'t be used with "replyto" or "replyroom". Ignoring reply '