borogove

created pr with borogove/multi-dm.1 on 2026-11-09T19:47:55Z · by 9e834e0d
added borogove/multi-dm.2 on 2026-11-10T19:08:22Z · by 9e834e0d
1: 0ef2769 = 1: 41e89c8 Use to for chatId if not in recipients
2: 90e5a6a = 2: c323e3d clone should clone attributes
3: d86ea28 = 3: a1199ae Actually send to all recipients
4: 1c1061f ! 4: 94bf87d Never add self as counterpart
5: 9c8aa41 = 5: 32b9fad Extended addressing for sent messages specifies all recipients
6: 2da9124 = 6: ce4d9e1 Always add all recipients to outbound message
7: e7db006 = 7: 350343e Use a shared helper for adding extended addressing
8: 4530ece = 8: 40f662a Add startMultiChat to create multiDMs
9: 6810ba9 = 9: 8043c53 Never include ourselves in incoming chat ids
-: ------- > 10: 68e7246 Cannot MAM or bookmark a multiDM
cmds
checkout latest patchset:
ssh pr.pico.sh pull borogove:multi-dm | git am -3
checkout specific patchset revision:
ssh pr.pico.sh pull borogove:multi-dm [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh borogove:multi-dm
add comment to patch request:
ssh pr.pico.sh comment borogove:multi-dm "lgtm!"
+2 -1 borogove/Chat.hx #
......@@ -1191,7 +1191,8 @@ class DirectChat extends Chat {
11911191 // If last message at load time is a sent message, this may not include everyone
11921192 if (_fullCounterparts.length < 2 && (message?.recipients?.length ?? 0) > 1) {
11931193 _fullCounterparts = message.recipients.map(r -> r.asBare().asString()).filter(id -> id != client.accountId());
1194- if (!_fullCounterparts.contains(message.senderId)) _fullCounterparts.push(message.senderId);
1194+ final senderId = JID.parse(message.senderId).asBare().asString();
1195+ if (senderId != client.accountId() && !_fullCounterparts.contains(senderId)) _fullCounterparts.push(senderId);
11951196 }
11961197 return super.setLastMessage(message);
11971198 }
+24 -0 test/TestChat.hx #
......@@ -1271,6 +1271,30 @@ class TestChat extends utest.Test {
12711271 chat.sendMessage(builder, borogove.Chat.OutgoingE2EEPreference.NoE2EE);
12721272 }
12731273
1274+ public function testCompatMultiDMParticipantsRecoveredFromOutgoingLastMessage(async: Async) {
1275+ final persistence = new Dummy();
1276+ final client = new Client("me@example.com", persistence);
1277+ final chat = new borogove.Chat.DirectChat(client, client.stream, persistence, "multi@example.com");
1278+
1279+ final builder = new ChatMessageBuilder();
1280+ builder.localId = "out-1";
1281+ builder.sortId = "a0";
1282+ builder.direction = MessageSent;
1283+ builder.from = JID.parse("me@example.com");
1284+ builder.senderId = "me@example.com";
1285+ builder.to = JID.parse("multi@example.com");
1286+ builder.recipients = [JID.parse("bob@example.com"), JID.parse("carol@example.com")];
1287+ builder.replyTo = [JID.parse("me@example.com")];
1288+
1289+ chat.setLastMessage(builder.build()).then(_ -> {
1290+ Assert.same(["bob@example.com", "carol@example.com"], chat._fullCounterparts);
1291+ chat.members().then(members -> {
1292+ final ids = members.map(m -> m.id);
1293+ Assert.same(["bob@example.com", "carol@example.com", "me@example.com"], ids);
1294+ async.done();
1295+ });
1296+ });
1297+ }
12741298 }
12751299
12761300 @:access(borogove)
Back to top