git » sdk » commit 1e29906

XEP0454 if the whole body is aesgcm uri assume attachment

author Stephen Paul Weber
2026-07-20 17:32:41 UTC
committer Stephen Paul Weber
2026-07-20 17:32:41 UTC
parent e49c53546bd112ef470a132a742b29226a3859b7

XEP0454 if the whole body is aesgcm uri assume attachment

borogove/Message.hx +6 -0

diff --git a/borogove/Message.hx b/borogove/Message.hx
index ceefa20..7643d16 100644
--- a/borogove/Message.hx
+++ b/borogove/Message.hx
@@ -255,6 +255,12 @@ class Message {
 			msg.attachSims(sims);
 		}
 
+		final aesgcmBody = XEP0454.parse(msg.text ?? "");
+		if (aesgcmBody != null && msg.text != null) {
+			msg.addAttachment(new ChatAttachment(null, aesgcmBody.mime, null, [msg.text], []));
+			msg.text = null;
+		}
+
 		final jmi = stanza.getChild(null, "urn:xmpp:jingle-message:0");
 		if (jmi != null && jmi.name != "accept") {
 			msg.type = MessageCall;