borogove

created pr with borogove/outgoing-e2ee-status.1 on 2026-11-11T22:04:33Z · by 9e834e0d
added borogove/outgoing-e2ee-status.2 on 2026-11-13T16:36:04Z · by 3c31bc8c
1: 9b2b378 = 1: b641e78 Record if a send message was e2ee
-: ------- > 2: 9dbe688 review comments
commented on 2026-11-13T16:36:05Z · by 3c31bc8c
borogove/Chat.hx:284 — I think this would read better like: return switch (e2eePreference) { case OMEMO: EncryptionInfo.forSent(NS.OMEMO); case NoE2EE: null; case Default: defaultE2ee(); };
added borogove/outgoing-e2ee-status.3 on 2026-11-16T16:26:38Z · by 9e834e0d
1: b641e78 ! 1: a6d1b46 Record if a send message was e2ee
2: 9dbe688 = 2: 8565503 review comments
-: ------- > 3: 6b1d111 comments
cmds
checkout latest patchset:
ssh pr.pico.sh pull borogove:outgoing-e2ee-status | git am -3
checkout specific patchset revision:
ssh pr.pico.sh pull borogove:outgoing-e2ee-status [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh borogove:outgoing-e2ee-status
add comment to patch request:
ssh pr.pico.sh comment borogove:outgoing-e2ee-status "lgtm!"

Patchset borogove/outgoing-e2ee-status.3 on 2026-11-16T16:26:38Z · commit a6d1b46

Record if a send message was e2ee
Stephen Paul Weber 2026-11-11T22:02:49Z
And also on re-send use the same e2ee originally intended.

We store with the intended e2ee before attempting, then if it turns out
we can't use e2ee and policy allows us to not, we update the DB with the
fact that we didn't actually to be accurate.
Semantic diff summary
0 added, 1 modified, 0 signature changed, 0 removed across 1 analyzed file (7 files skipped: unsupported file type)
+46 -24 borogove/Chat.hx #
......@@ -271,7 +271,23 @@ abstract class Chat extends EventEmitter {
271271
272272 @:allow(borogove)
273273 // Not abstract to work around https://github.com/HaxeFoundation/haxe/issues/11666
274- private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default):Void { }
274+ private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default):Promise<Null<EncryptionInfo>> { throw "Not implemented"; }
275+
276+ private function defaultE2ee():OutgoingE2EEPreference {
277+ return client.outgoingE2EEPreference[0];
278+ }
279+
280+ private function intendedEncryption(e2eePreference:OutgoingE2EEPreference):Null<EncryptionInfo> {
281+ #if NO_OMEMO
282+ return null;
283+ #else
284+ return switch (e2eePreference) {
285+ case OMEMO: EncryptionInfo.forSent(NS.OMEMO);
286+ case NoE2EE: null;
287+ case Default: defaultE2ee();
288+ };
289+ #end
290+ }
275291
276292 /**
277293 Signals that all messages up to and including this one have probably
......@@ -1270,7 +1286,7 @@ class DirectChat extends Chat {
12701286 return message;
12711287 }
12721288
1273- private function prepareOutgoingMessage(message:ChatMessageBuilder) {
1289+ private function prepareOutgoingMessage(message:ChatMessageBuilder, e2eePreference:OutgoingE2EEPreference = Default) {
12741290 message.timeSent = message.timeSent ?? Date.format(std.Date.now());
12751291 message.timeReceived = Date.format(std.Date.now());
12761292 message.direction = MessageSent;
......@@ -1280,6 +1296,7 @@ class DirectChat extends Chat {
12801296 message.recipients = counterparts().map((p) -> JID.parse(p));
12811297 message.to = message.recipients[0];
12821298 if (message.localId == null) message.localId = ID.unique();
1299+ if (message.encryption == null) message.encryption = intendedEncryption(e2eePreference);
12831300 return message;
12841301 }
12851302
......@@ -1293,7 +1310,7 @@ class DirectChat extends Chat {
12931310 client.storeMessageBuilder(message).then((corrected) -> {
12941311 message.versions = corrected.versions[corrected.versions.length - 1]?.localId == correct.localId ? cast corrected.versions : [message.build()];
12951312 message.localId = toSendId;
1296- sendMessageStanza(message.build().asStanza(), outboxItem);
1313+ sendMessageStanza(message.build().asStanza(), outboxItem).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
12971314 if (lastMessage == null || corrected.canReplace(lastMessage)) {
12981315 setLastMessage(corrected).then(_ ->
12991316 client.trigger("chats/update", [this])
......@@ -1307,7 +1324,7 @@ class DirectChat extends Chat {
13071324 if (uiState == Invited) uiState = Open;
13081325 if (typingTimer != null) typingTimer.stop();
13091326 client.chatActivity(this);
1310- message = prepareOutgoingMessage(message);
1327+ message = prepareOutgoingMessage(message, e2eePreference);
13111328 message.to = message.recipients[0]; // Just pick one for the stanza we re-parse
13121329 final fromStanza = Message.fromStanza(message.build().asStanza(), client.jid).parsed;
13131330 switch (fromStanza) {
......@@ -1320,7 +1337,7 @@ class DirectChat extends Chat {
13201337 activeThread = message.threadId;
13211338 stanza.tag("active", { xmlns: "http://jabber.org/protocol/chatstates" }).up();
13221339 }
1323- sendMessageStanza(stanza, outboxItem, e2eePreference);
1340+ sendMessageStanza(stanza, outboxItem, e2eePreference).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
13241341 setLastMessage(stored).then(_ -> {
13251342 client.notifyMessageHandlers(stored, stored.versions.length > 1 ? CorrectionEvent : DeliveryEvent);
13261343 client.trigger("chats/update", [this]);
......@@ -1378,13 +1395,13 @@ class DirectChat extends Chat {
13781395 });
13791396 }
13801397
1381- override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default) {
1398+ override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default):Promise<Null<EncryptionInfo>> {
13821399 if (stanza.name != "message") throw "Can only send message stanza this way";
13831400
13841401 if (outboxItem == null) outboxItem = outbox.newItem();
13851402
13861403 final counters = counterparts();
1387- thenshim.PromiseTools.all(counters.map(counterpart -> {
1404+ return thenshim.PromiseTools.all(counters.map(counterpart -> {
13881405 final clone = stanza.clone();
13891406 clone.attr.set("to", counterpart);
13901407 if (counters.length > 1 && stanza.getChild("addresses", "http://jabber.org/protocol/address") == null) {
......@@ -1400,26 +1417,27 @@ class DirectChat extends Chat {
14001417 if (e2eePreference == Default) e2eePreference = client.outgoingE2EEPreference[0];
14011418 #if NO_OMEMO
14021419 if (e2eePreference != NoE2EE) throw "Selected E2EE preference unsupported";
1403- return Promise.resolve(stanza);
1420+ return Promise.resolve({ stanza: stanza, encryptionInfo: null });
14041421 #else
14051422 switch (e2eePreference) {
14061423 case OMEMO:
14071424 // As written this falls back to NoE2EE if allowed
1408- return client.omemo.encryptMessage([JID.parse(counterpart)], stanza).then((encryptedStanza) -> {
1409- return Promise.resolve(encryptedStanza);
1425+ return client.omemo.encryptMessage([JID.parse(counterpart)], stanza).then((outcome) -> {
1426+ return Promise.resolve({ stanza: outcome.stanza, encryptionInfo: outcome.encryptionInfo });
14101427 });
14111428 case NoE2EE:
1412- return Promise.resolve(stanza);
1429+ return Promise.resolve({ stanza: stanza, encryptionInfo: null });
14131430 case Default:
14141431 throw "Impossible";
14151432 }
14161433 #end
1417- })).then(stanzas -> {
1434+ })).then(outcomes -> {
14181435 outboxItem.handle(() -> {
1419- for (stanza in stanzas) {
1420- client.sendStanza(stanza);
1436+ for (outcome in outcomes) {
1437+ client.sendStanza(outcome.stanza);
14211438 }
14221439 });
1440+ return Promise.resolve(outcomes.fold((x, y) -> x.encryptionInfo == null || y == null ? null : x.encryptionInfo, outcomes[0].encryptionInfo));
14231441 });
14241442 }
14251443
......@@ -2495,7 +2513,7 @@ class Channel extends Chat {
24952513 return message;
24962514 }
24972515
2498- private function prepareOutgoingMessage(message:ChatMessageBuilder) {
2516+ private function prepareOutgoingMessage(message:ChatMessageBuilder, e2eePreference:OutgoingE2EEPreference = Default) {
24992517 message.type = MessageChannel;
25002518 message.timeSent = message.timeSent ?? Date.format(std.Date.now());
25012519 message.timeReceived = Date.format(std.Date.now());
......@@ -2516,6 +2534,7 @@ class Channel extends Chat {
25162534 sortId: { method: "between", lower: lower, upper: null },
25172535 };
25182536 }
2537+ if (message.encryption == null) message.encryption = intendedEncryption(e2eePreference);
25192538 return message;
25202539 }
25212540
......@@ -2529,7 +2548,7 @@ class Channel extends Chat {
25292548 client.storeMessageBuilder(message).then((corrected) -> {
25302549 message.versions = corrected.versions[0]?.localId == correct.localId ? cast corrected.versions : [message.build()];
25312550 message.localId = toSendId;
2532- sendMessageStanza(message.build().asStanza(), outboxItem);
2551+ sendMessageStanza(message.build().asStanza(), outboxItem).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
25332552 client.notifyMessageHandlers(corrected, CorrectionEvent);
25342553 if (lastMessage == null || corrected.canReplace(lastMessage)) {
25352554 setLastMessage(corrected).then(_ ->
......@@ -2543,7 +2562,7 @@ class Channel extends Chat {
25432562 if (uiState == Invited) uiState = Open;
25442563 if (typingTimer != null) typingTimer.stop();
25452564 client.chatActivity(this);
2546- message = prepareOutgoingMessage(message);
2565+ message = prepareOutgoingMessage(message, e2eePreference);
25472566 final stanza = message.build().asStanza();
25482567 // Fake from as it will look on reflection for storage purposes
25492568 stanza.attr.set("from", getFullJid().asString());
......@@ -2561,7 +2580,7 @@ class Channel extends Chat {
25612580 }
25622581 final outboxItem = outbox.newItem();
25632582 client.storeMessageBuilder(message).then((stored) -> {
2564- sendMessageStanza(stanza, outboxItem);
2583+ sendMessageStanza(stanza, outboxItem, e2eePreference).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
25652584 setLastMessage(stored).then(_ -> {
25662585 client.notifyMessageHandlers(stored, stored.versions.length > 1 ? CorrectionEvent : DeliveryEvent);
25672586 client.trigger("chats/update", [this]);
......@@ -2615,7 +2634,7 @@ class Channel extends Chat {
26152634 }
26162635
26172636 // TODO: this is a gross heuristic. Large private groups that don't want e2ee are possible for example
2618- private function defaultE2ee() {
2637+ override private function defaultE2ee() {
26192638 if (!client.outgoingE2EEPreference.exists(p -> p == NoE2EE)) {
26202639 // Must E2EE
26212640 return client.outgoingE2EEPreference[0];
......@@ -2626,7 +2645,7 @@ class Channel extends Chat {
26262645 return client.outgoingE2EEPreference[0];
26272646 }
26282647
2629- override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default) {
2648+ override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default):Promise<Null<EncryptionInfo>> {
26302649 if (stanza.name != "message") throw "Can only send message stanza this way";
26312650
26322651 if (outboxItem == null) outboxItem = outbox.newItem();
......@@ -2639,19 +2658,22 @@ class Channel extends Chat {
26392658 #if NO_OMEMO
26402659 if (e2eePreference != NoE2EE) throw "Selected E2EE preference unsupported";
26412660 outboxItem.handle(() -> client.sendStanza(stanza));
2661+ return Promise.resolve(null);
26422662 #else
26432663 switch (e2eePreference) {
26442664 case OMEMO:
26452665 // As written this falls back to NoE2EE if allowed and no one has OMEMO
26462666 // TODO: on some rooms, especially very large ones this may not be a full
26472667 // list of members. In practise it is fine anywhere OMEMO could actually work
2648- members().then(members ->
2668+ return members().then(members ->
26492669 client.omemo.encryptMessage(members.map(member -> JID.parse(member.chat?.chatId)), stanza)
2650- ).then((encryptedStanza) ->
2651- outboxItem.handle(() -> client.sendStanza(encryptedStanza))
2652- );
2670+ ).then((outcome) -> {
2671+ outboxItem.handle(() -> client.sendStanza(outcome.stanza));
2672+ return Promise.resolve(outcome.encryptionInfo);
2673+ });
26532674 case NoE2EE:
26542675 outboxItem.handle(() -> client.sendStanza(stanza));
2676+ return Promise.resolve(null);
26552677 case Default:
26562678 throw "Impossible";
26572679 }
+23 -2 borogove/Client.hx #
......@@ -2188,6 +2188,23 @@ class Client extends EventEmitter {
21882188 })).then(updatedMessages -> persistence.storeMessages(accountId(), updatedMessages));
21892189 }
21902190
2191+ @:allow(borogove)
2192+ private function applySentEncryption(chat: Chat, builder: ChatMessageBuilder, encryption: Null<EncryptionInfo>) {
2193+ final stored = builder.encryption;
2194+ if (stored == encryption || (stored != null && encryption != null && stored.status == encryption.status && stored.method == encryption.method)) {
2195+ return Promise.resolve(null);
2196+ }
2197+
2198+ builder.encryption = encryption;
2199+ return storeMessageBuilder(builder).then(updated -> {
2200+ if (chat.lastMessage != null && chat.lastMessage.canReplace(updated)) {
2201+ chat.setLastMessage(updated).then(_ -> trigger("chats/update", [chat]));
2202+ }
2203+ notifyMessageHandlers(updated, StatusEvent);
2204+ return null;
2205+ });
2206+ }
2207+
21912208 private function checkForResends() {
21922209 var tooOld = Date.format(
21932210 DateTools.delta(std.Date.now(), DateTools.hours(-3))
......@@ -2210,8 +2227,12 @@ class Client extends EventEmitter {
22102227 from: accountId(),
22112228 stamp: m.timeSent
22122229 });
2213- // TODO: don't know if was originally send with OMEMO
2214- chat.sendMessageStanza(stanza);
2230+ // Don't silently downgrade a message that was meant to be encrypted
2231+ var preference:OutgoingE2EEPreference = Default;
2232+ #if !NO_OMEMO
2233+ if (m.encryption != null) preference = OMEMO;
2234+ #end
2235+ chat.sendMessageStanza(stanza, null, preference).then((encryption) -> applySentEncryption(chat, ChatMessageBuilder.fromMessage(m), encryption));
22152236 }
22162237 }
22172238 }
+8 -2 borogove/EncryptionInfo.hx #
......@@ -8,7 +8,7 @@ import HaxeCBridge;
88 Outcome of decrypting an incoming message.
99 **/
1010 enum abstract EncryptionStatus(Int) {
11- var DecryptionSuccess; // Message was encrypted, and we decrypted it
11+ var EncryptionInfoSuccess; // Incoming: message was encrypted and we decrypted it. Outgoing: message was encrypted
1212 var DecryptionFailure; // Message is encrypted, and we failed to decrypt it
1313 }
1414
......@@ -48,7 +48,7 @@ class EncryptionInfo {
4848 final el = new Stanza("decryption-status", {
4949 xmlns: "https://borogove.dev/protocol/sdk",
5050 encryption: this.method,
51- result: status == DecryptionSuccess?"success":"failure",
51+ result: status == EncryptionInfoSuccess?"success":"failure",
5252 });
5353 if(reason != null) {
5454 el.textTag("reason", reason);
......@@ -59,6 +59,12 @@ class EncryptionInfo {
5959 return el;
6060 }
6161
62+ // We encrypted an outgoing message with this method
63+ @:allow(borogove)
64+ static private function forSent(method:String):EncryptionInfo {
65+ return new EncryptionInfo(EncryptionInfoSuccess, method);
66+ }
67+
6268 // Typically used to deduce an EncryptionInfo when none has been provided
6369 // May return null if the stanza is not recognizably encrypted.
6470 @:allow(borogove)
+12 -6 borogove/OMEMO.hx #
......@@ -311,6 +311,11 @@ class OMEMODecryptionResult {
311311 }
312312 }
313313
314+typedef OMEMOEncryptionOutcome = {
315+ final stanza:Stanza;
316+ final encryptionInfo:Null<EncryptionInfo>;
317+};
318+
314319 @:expose
315320 class OMEMOSessionMetadata {
316321 // True when we have successfully received and decrypted any
......@@ -932,7 +937,7 @@ class OMEMO {
932937 return Promise.resolve(new OMEMODecryptionResult(
933938 stanza,
934939 new EncryptionInfo(
935- DecryptionSuccess,
940+ EncryptionInfoSuccess,
936941 NS.OMEMO,
937942 )
938943 ));
......@@ -959,7 +964,7 @@ class OMEMO {
959964 // No metadata in storage, so create a default
960965 metadata = new OMEMOSessionMetadata(false, false, false);
961966 }
962- final decryptedOk = decryptionResult.encryptionInfo.status == DecryptionSuccess;
967+ final decryptedOk = decryptionResult.encryptionInfo.status == EncryptionInfoSuccess;
963968 var needUpdate = metadata.lastMessageDecryptedOk != decryptedOk;
964969 final receivedSessionMessage = deviceKey != null && !deviceKey.prekey;
965970 needUpdate = needUpdate || receivedSessionMessage != metadata.receivedSessionMessageOk;
......@@ -1093,7 +1098,7 @@ class OMEMO {
10931098 });
10941099 }
10951100
1096- public function encryptMessage(recipients: Array<JID>, stanza:Stanza):Promise<Stanza> {
1101+ public function encryptMessage(recipients: Array<JID>, stanza:Stanza):Promise<OMEMOEncryptionOutcome> {
10971102 final promHeader = thenshim.PromiseTools.all(recipients.map(getContactDevices)).then(raddresses -> {
10981103 final raddrs = raddresses.flatMap(addrs -> addrs);
10991104
......@@ -1125,7 +1130,7 @@ class OMEMO {
11251130 newStanza.addChild(header);
11261131 newStanza.textTag("encryption", "", { xmlns: "urn:xmpp:eme:0", namespace: "eu.siacs.conversations.axolotl" });
11271132 newStanza.textTag("body", "I sent you an OMEMO encrypted message but your client doesn’t seem to support that. Find more information on https://conversations.im/omemo");
1128- return newStanza;
1133+ return { stanza: newStanza, encryptionInfo: EncryptionInfo.forSent(NS.OMEMO) };
11291134 }, (failureReason) -> {
11301135 final noRecipientSupport = failureReason == "no-devices";
11311136 var allowUnencrypted:Bool = client.outgoingE2EEPreference.exists(p -> p == NoE2EE);
......@@ -1152,9 +1157,10 @@ class OMEMO {
11521157
11531158 trace("OMEMO: Skipping encryption (permitted by policy): " + errMsg);
11541159
1155- // Encryption failed, but policy says this is ok.
1160+ // Encryption failed, but policy says this is ok. The message goes
1161+ // out unencrypted, so no EncryptionInfo is recorded for it.
11561162 // Just pass through the original stanza to be sent.
1157- return stanza;
1163+ return { stanza: stanza, encryptionInfo: null };
11581164 });
11591165
11601166 return promStanza;
+5 -2 test/TestChat.hx #
......@@ -1209,10 +1209,13 @@ class TestChat extends utest.Test {
12091209 final chat = client.getDirectChat("friend@example.com");
12101210
12111211 Reflect.setField(client, "omemo", {
1212- encryptMessage: function(jid: borogove.JID, stanza: Stanza) {
1212+ encryptMessage: function(jids: Array<borogove.JID>, stanza: Stanza) {
12131213 final encrypted = stanza.clone();
12141214 encrypted.tag("encrypted", { xmlns: "eu.siacs.conversations.axolotl" }).up();
1215- return Promise.resolve(encrypted);
1215+ return Promise.resolve({
1216+ stanza: encrypted,
1217+ encryptionInfo: new borogove.EncryptionInfo(EncryptionInfoSuccess, "eu.siacs.conversations.axolotl")
1218+ });
12161219 }
12171220 });
12181221
+64 -0 test/TestClient.hx #
......@@ -23,6 +23,7 @@ import borogove.Stanza;
2323 import borogove.Status;
2424 import borogove.persistence.Dummy;
2525 import borogove.Chat.OutgoingE2EEPreference;
26+import borogove.EncryptionInfo;
2627 import borogove.AttachmentUploadError;
2728 import borogove.AttachmentUploadErrorCode;
2829 #if !NO_OMEMO
......@@ -663,6 +664,69 @@ class TestClient extends utest.Test {
663664 });
664665 }
665666
667+ #if !NO_OMEMO
668+ public function testSentMessageRecordsEncryption(async: Async) {
669+ final persistence = new MessageMockPersistence();
670+ final client = new Client("test@example.com", persistence);
671+ final chat = client.getDirectChat("friend@example.com");
672+
673+ Reflect.setField(client, "omemo", {
674+ encryptMessage: function(jids: Array<JID>, stanza: Stanza) {
675+ final encrypted = stanza.clone();
676+ encrypted.tag("encrypted", { xmlns: "eu.siacs.conversations.axolotl" }).up();
677+ return Promise.resolve({
678+ stanza: encrypted,
679+ encryptionInfo: new borogove.EncryptionInfo(EncryptionInfoSuccess, "eu.siacs.conversations.axolotl")
680+ });
681+ }
682+ });
683+
684+ client.stream.on("sendStanza", (stanza: Stanza) -> {
685+ if (stanza.name != "message") return EventUnhandled;
686+ final stored = persistence.messages.get(stanza.attr.get("id"));
687+ Assert.notNull(stored);
688+ Assert.notNull(stored?.encryption);
689+ Assert.equals(EncryptionInfoSuccess, stored?.encryption?.status);
690+ Assert.equals("eu.siacs.conversations.axolotl", stored?.encryption?.method);
691+ Assert.equals("OMEMO", stored?.encryption?.methodName);
692+ async.done();
693+ return EventHandled;
694+ });
695+
696+ final builder = new ChatMessageBuilder();
697+ builder.text = "hello";
698+ chat.sendMessage(builder, borogove.Chat.OutgoingE2EEPreference.OMEMO);
699+ }
700+
701+ public function testSentMessageRecordsFallbackAsUnencrypted(async: Async) {
702+ final persistence = new MessageMockPersistence();
703+ final client = new Client("test@example.com", persistence);
704+ final chat = client.getDirectChat("friend@example.com");
705+
706+ Reflect.setField(client, "omemo", {
707+ encryptMessage: function(jids: Array<JID>, stanza: Stanza) {
708+ return Promise.resolve({ stanza: stanza.clone(), encryptionInfo: null });
709+ }
710+ });
711+
712+ var finished = false;
713+ client.on("message/new", (data: { message: ChatMessage, event: ChatMessageEvent }) -> {
714+ if (data.event != StatusEvent || finished) return EventUnhandled;
715+ Assert.isNull(data.message.encryption);
716+ Assert.isNull(persistence.messages.get(data.message.localId)?.encryption);
717+ Assert.equals(data.message.localId, chat.lastMessage?.localId);
718+ Assert.isNull(chat.lastMessage?.encryption);
719+ finished = true;
720+ async.done();
721+ return EventHandled;
722+ });
723+
724+ final builder = new ChatMessageBuilder();
725+ builder.text = "hello";
726+ chat.sendMessage(builder, borogove.Chat.OutgoingE2EEPreference.OMEMO);
727+ }
728+ #end
729+
666730 public function testDefaultDisplayName() {
667731 final persistence = new Dummy();
668732 final client = new Client("test@example.com", persistence);
+2 -2 test/TestSqlite.hx #
......@@ -879,7 +879,7 @@ class TestSqlite extends utest.Test {
879879 final chatId = "encryption-correction-hatter@example.com";
880880 final originalExpected = {
881881 text: "Original encrypted text",
882- encryption: new EncryptionInfo(DecryptionSuccess, "urn:xmpp:omemo:1", null, null, "OMEMO 1")
882+ encryption: new EncryptionInfo(EncryptionInfoSuccess, "urn:xmpp:omemo:1", null, null, "OMEMO 1")
883883 };
884884 final original = makeMessage({
885885 timestamp: "2026-08-26T12:00:00Z",
......@@ -1011,7 +1011,7 @@ class TestSqlite extends utest.Test {
10111011
10121012 public function testUpdateMessageStatus(async: Async) {
10131013 final account = "alice@example.com";
1014- final expectedEncryption = new EncryptionInfo(DecryptionSuccess, "eu.siacs.conversations.axolotl", null, null, "OMEMO");
1014+ final expectedEncryption = new EncryptionInfo(EncryptionInfoSuccess, "eu.siacs.conversations.axolotl", null, null, "OMEMO");
10151015 final builder = new ChatMessageBuilder();
10161016 builder.localId = "loc1";
10171017 builder.senderId = "alice@example.com";
+2 -2 test/persistence-tests.ts #
......@@ -455,7 +455,7 @@ export function sharedPersistenceTests(test) {
455455 builder.recipients = [builder.to];
456456 builder.replyTo = [builder.from];
457457 builder.encryption = {
458- status: borogove.EncryptionStatus.DecryptionSuccess,
458+ status: borogove.EncryptionStatus.EncryptionInfoSuccess,
459459 method: "eu.siacs.conversations.axolotl",
460460 methodName: "OMEMO",
461461 reason: null,
......@@ -503,7 +503,7 @@ export function sharedPersistenceTests(test) {
503503 originalBuilder.recipients = [originalBuilder.to];
504504 originalBuilder.replyTo = [originalBuilder.from];
505505 originalBuilder.encryption = {
506- status: borogove.EncryptionStatus.DecryptionSuccess,
506+ status: borogove.EncryptionStatus.EncryptionInfoSuccess,
507507 method: "urn:xmpp:omemo:1",
508508 methodName: "OMEMO 1",
509509 reason: null,
Back to top