git » sdk » commit bffdcc4

Parse tombstones properly

author Stephen Paul Weber
2026-04-29 03:05:14 UTC
committer Stephen Paul Weber
2026-04-29 03:13:01 UTC
parent 276a46d286d4fcbabe01b5b91846308e6d66242f

Parse tombstones properly

Especially since sqlite driver uses this parser for hydration

borogove/Message.hx +7 -1

diff --git a/borogove/Message.hx b/borogove/Message.hx
index ba3c45f..4583dca 100644
--- a/borogove/Message.hx
+++ b/borogove/Message.hx
@@ -256,10 +256,16 @@ class Message {
 			);
 		}
 
+		final retracted = stanza.getChild("retracted", "urn:xmpp:message-retract:1");
+		if (retracted != null) {
+			// Store tombstone
+			msg.payloads.push(retracted);
+		}
+
 		final replace = stanza.getChild("replace", "urn:xmpp:message-correct:0");
 		final replaceId  = replace?.attr?.get("id");
 
-		if (msg.text == null && msg.attachments.length < 1 && replaceId == null) {
+		if (msg.text == null && msg.attachments.length < 1 && replaceId == null && retracted == null) {
 			if (msg.payloads.length == 1 && msg.payloads[0].name == "subject") {
 				return new Message(msg.chatId(), msg.senderId, msg.threadId, SubjectStanza(msg.payloads[0].getText()), encryptionInfo);
 			}