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.1 on 2026-11-11T22:04:33Z · commit 9b2b378

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)
+47 -24 borogove/Chat.hx #
......@@ -271,7 +271,24 @@ 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+ if (e2eePreference == Default) e2eePreference = defaultE2ee();
285+ return switch (e2eePreference) {
286+ case OMEMO: EncryptionInfo.forSent(NS.OMEMO);
287+ case NoE2EE: null;
288+ case Default: throw "Impossible";
289+ };
290+ #end
291+ }
275292
276293 /**
277294 Signals that all messages up to and including this one have probably
......@@ -1270,7 +1287,7 @@ class DirectChat extends Chat {
12701287 return message;
12711288 }
12721289
1273- private function prepareOutgoingMessage(message:ChatMessageBuilder) {
1290+ private function prepareOutgoingMessage(message:ChatMessageBuilder, e2eePreference:OutgoingE2EEPreference = Default) {
12741291 message.timeSent = message.timeSent ?? Date.format(std.Date.now());
12751292 message.timeReceived = Date.format(std.Date.now());
12761293 message.direction = MessageSent;
......@@ -1280,6 +1297,7 @@ class DirectChat extends Chat {
12801297 message.recipients = counterparts().map((p) -> JID.parse(p));
12811298 message.to = message.recipients[0];
12821299 if (message.localId == null) message.localId = ID.unique();
1300+ if (message.encryption == null) message.encryption = intendedEncryption(e2eePreference);
12831301 return message;
12841302 }
12851303
......@@ -1293,7 +1311,7 @@ class DirectChat extends Chat {
12931311 client.storeMessageBuilder(message).then((corrected) -> {
12941312 message.versions = corrected.versions[corrected.versions.length - 1]?.localId == correct.localId ? cast corrected.versions : [message.build()];
12951313 message.localId = toSendId;
1296- sendMessageStanza(message.build().asStanza(), outboxItem);
1314+ sendMessageStanza(message.build().asStanza(), outboxItem).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
12971315 if (lastMessage == null || corrected.canReplace(lastMessage)) {
12981316 setLastMessage(corrected).then(_ ->
12991317 client.trigger("chats/update", [this])
......@@ -1307,7 +1325,7 @@ class DirectChat extends Chat {
13071325 if (uiState == Invited) uiState = Open;
13081326 if (typingTimer != null) typingTimer.stop();
13091327 client.chatActivity(this);
1310- message = prepareOutgoingMessage(message);
1328+ message = prepareOutgoingMessage(message, e2eePreference);
13111329 message.to = message.recipients[0]; // Just pick one for the stanza we re-parse
13121330 final fromStanza = Message.fromStanza(message.build().asStanza(), client.jid).parsed;
13131331 switch (fromStanza) {
......@@ -1320,7 +1338,7 @@ class DirectChat extends Chat {
13201338 activeThread = message.threadId;
13211339 stanza.tag("active", { xmlns: "http://jabber.org/protocol/chatstates" }).up();
13221340 }
1323- sendMessageStanza(stanza, outboxItem, e2eePreference);
1341+ sendMessageStanza(stanza, outboxItem, e2eePreference).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
13241342 setLastMessage(stored).then(_ -> {
13251343 client.notifyMessageHandlers(stored, stored.versions.length > 1 ? CorrectionEvent : DeliveryEvent);
13261344 client.trigger("chats/update", [this]);
......@@ -1378,13 +1396,13 @@ class DirectChat extends Chat {
13781396 });
13791397 }
13801398
1381- override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default) {
1399+ override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default):Promise<Null<EncryptionInfo>> {
13821400 if (stanza.name != "message") throw "Can only send message stanza this way";
13831401
13841402 if (outboxItem == null) outboxItem = outbox.newItem();
13851403
13861404 final counters = counterparts();
1387- thenshim.PromiseTools.all(counters.map(counterpart -> {
1405+ return thenshim.PromiseTools.all(counters.map(counterpart -> {
13881406 final clone = stanza.clone();
13891407 clone.attr.set("to", counterpart);
13901408 if (counters.length > 1 && stanza.getChild("addresses", "http://jabber.org/protocol/address") == null) {
......@@ -1400,26 +1418,27 @@ class DirectChat extends Chat {
14001418 if (e2eePreference == Default) e2eePreference = client.outgoingE2EEPreference[0];
14011419 #if NO_OMEMO
14021420 if (e2eePreference != NoE2EE) throw "Selected E2EE preference unsupported";
1403- return Promise.resolve(stanza);
1421+ return Promise.resolve({ stanza: stanza, encryptionInfo: null });
14041422 #else
14051423 switch (e2eePreference) {
14061424 case OMEMO:
14071425 // 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);
1426+ return client.omemo.encryptMessage([JID.parse(counterpart)], stanza).then((outcome) -> {
1427+ return Promise.resolve({ stanza: outcome.stanza, encryptionInfo: outcome.encryptionInfo });
14101428 });
14111429 case NoE2EE:
1412- return Promise.resolve(stanza);
1430+ return Promise.resolve({ stanza: stanza, encryptionInfo: null });
14131431 case Default:
14141432 throw "Impossible";
14151433 }
14161434 #end
1417- })).then(stanzas -> {
1435+ })).then(outcomes -> {
14181436 outboxItem.handle(() -> {
1419- for (stanza in stanzas) {
1420- client.sendStanza(stanza);
1437+ for (outcome in outcomes) {
1438+ client.sendStanza(outcome.stanza);
14211439 }
14221440 });
1441+ return Promise.resolve(outcomes.fold((x, y) -> x.encryptionInfo == null || y == null ? null : x.encryptionInfo, outcomes[0].encryptionInfo));
14231442 });
14241443 }
14251444
......@@ -2495,7 +2514,7 @@ class Channel extends Chat {
24952514 return message;
24962515 }
24972516
2498- private function prepareOutgoingMessage(message:ChatMessageBuilder) {
2517+ private function prepareOutgoingMessage(message:ChatMessageBuilder, e2eePreference:OutgoingE2EEPreference = Default) {
24992518 message.type = MessageChannel;
25002519 message.timeSent = message.timeSent ?? Date.format(std.Date.now());
25012520 message.timeReceived = Date.format(std.Date.now());
......@@ -2516,6 +2535,7 @@ class Channel extends Chat {
25162535 sortId: { method: "between", lower: lower, upper: null },
25172536 };
25182537 }
2538+ if (message.encryption == null) message.encryption = intendedEncryption(e2eePreference);
25192539 return message;
25202540 }
25212541
......@@ -2529,7 +2549,7 @@ class Channel extends Chat {
25292549 client.storeMessageBuilder(message).then((corrected) -> {
25302550 message.versions = corrected.versions[0]?.localId == correct.localId ? cast corrected.versions : [message.build()];
25312551 message.localId = toSendId;
2532- sendMessageStanza(message.build().asStanza(), outboxItem);
2552+ sendMessageStanza(message.build().asStanza(), outboxItem).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
25332553 client.notifyMessageHandlers(corrected, CorrectionEvent);
25342554 if (lastMessage == null || corrected.canReplace(lastMessage)) {
25352555 setLastMessage(corrected).then(_ ->
......@@ -2543,7 +2563,7 @@ class Channel extends Chat {
25432563 if (uiState == Invited) uiState = Open;
25442564 if (typingTimer != null) typingTimer.stop();
25452565 client.chatActivity(this);
2546- message = prepareOutgoingMessage(message);
2566+ message = prepareOutgoingMessage(message, e2eePreference);
25472567 final stanza = message.build().asStanza();
25482568 // Fake from as it will look on reflection for storage purposes
25492569 stanza.attr.set("from", getFullJid().asString());
......@@ -2561,7 +2581,7 @@ class Channel extends Chat {
25612581 }
25622582 final outboxItem = outbox.newItem();
25632583 client.storeMessageBuilder(message).then((stored) -> {
2564- sendMessageStanza(stanza, outboxItem);
2584+ sendMessageStanza(stanza, outboxItem, e2eePreference).then((encryptionInfo) -> client.applySentEncryption(this, message, encryptionInfo));
25652585 setLastMessage(stored).then(_ -> {
25662586 client.notifyMessageHandlers(stored, stored.versions.length > 1 ? CorrectionEvent : DeliveryEvent);
25672587 client.trigger("chats/update", [this]);
......@@ -2615,7 +2635,7 @@ class Channel extends Chat {
26152635 }
26162636
26172637 // TODO: this is a gross heuristic. Large private groups that don't want e2ee are possible for example
2618- private function defaultE2ee() {
2638+ override private function defaultE2ee() {
26192639 if (!client.outgoingE2EEPreference.exists(p -> p == NoE2EE)) {
26202640 // Must E2EE
26212641 return client.outgoingE2EEPreference[0];
......@@ -2626,7 +2646,7 @@ class Channel extends Chat {
26262646 return client.outgoingE2EEPreference[0];
26272647 }
26282648
2629- override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default) {
2649+ override private function sendMessageStanza(stanza: Stanza, ?outboxItem: OutboxItem, e2eePreference: OutgoingE2EEPreference = Default):Promise<Null<EncryptionInfo>> {
26302650 if (stanza.name != "message") throw "Can only send message stanza this way";
26312651
26322652 if (outboxItem == null) outboxItem = outbox.newItem();
......@@ -2639,19 +2659,22 @@ class Channel extends Chat {
26392659 #if NO_OMEMO
26402660 if (e2eePreference != NoE2EE) throw "Selected E2EE preference unsupported";
26412661 outboxItem.handle(() -> client.sendStanza(stanza));
2662+ return Promise.resolve(null);
26422663 #else
26432664 switch (e2eePreference) {
26442665 case OMEMO:
26452666 // As written this falls back to NoE2EE if allowed and no one has OMEMO
26462667 // TODO: on some rooms, especially very large ones this may not be a full
26472668 // list of members. In practise it is fine anywhere OMEMO could actually work
2648- members().then(members ->
2669+ return members().then(members ->
26492670 client.omemo.encryptMessage(members.map(member -> JID.parse(member.chat?.chatId)), stanza)
2650- ).then((encryptedStanza) ->
2651- outboxItem.handle(() -> client.sendStanza(encryptedStanza))
2652- );
2671+ ).then((outcome) -> {
2672+ outboxItem.handle(() -> client.sendStanza(outcome.stanza));
2673+ return Promise.resolve(outcome.encryptionInfo);
2674+ });
26532675 case NoE2EE:
26542676 outboxItem.handle(() -> client.sendStanza(stanza));
2677+ return Promise.resolve(null);
26552678 case Default:
26562679 throw "Impossible";
26572680 }
+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