core (xmpp): Prevent non printable message to be displayed:

We now use `client.is_message_printable` to check if message is printable. If it's not, we
block storage in DB and sending to bridge. The previous code could let message pass if
metadata were stored in `extra`.
This commit is contained in:
Goffi 2026-07-21 19:11:17 +02:00
commit 4b235fc86b

View file

@ -1840,7 +1840,7 @@ class SatMessageProtocol(xmppim.MessageProtocol):
await post_treat
self.complete_attachments(data)
if not data["message"] and not data["extra"] and not data["subject"]:
if not client.is_message_printable(data):
raise exceptions.CancelError("Cancelled empty message")
if not client.is_component or client.receiveHistory:
await self.add_to_history(data)