borogove
created pr with
borogove/multi-dm.1
added borogove/multi-dm.2
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 -3checkout specific patchset revision:
ssh pr.pico.sh pull borogove:multi-dm [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh borogove:multi-dmadd comment to patch request:
ssh pr.pico.sh comment borogove:multi-dm "lgtm!"
Patchset
borogove/multi-dm.1
Use to for chatId if not in recipients
Stephen Paul Weber
clone should clone attributes
2026-11-08T19:15:14ZStephen Paul Weber
Actually send to all recipients
2026-11-09T16:18:06ZStephen Paul Weber
→ Never add self as counterpart
2026-11-09T16:24:50ZStephen Paul Weber
Extended addressing for sent messages specifies all recipients
2026-11-08T19:20:04ZStephen Paul Weber
Always add all recipients to outbound message
2026-11-08T19:20:46ZStephen Paul Weber
Use a shared helper for adding extended addressing
2026-11-08T19:21:50ZStephen Paul Weber
Add startMultiChat to create multiDMs
2026-11-08T19:32:30ZStephen Paul Weber
Never include ourselves in incoming chat ids
2026-11-08T21:01:35ZStephen Paul Weber
2026-11-09T19:40:59Z
Never add self as counterpart
Stephen Paul Weber
2026-11-08T19:20:04ZSemantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(2 files skipped: unsupported file type)
+1
-1
borogove/Chat.hx
#
| ... | ... | @@ -1190,7 +1190,7 @@ class DirectChat extends Chat { | |
| 1190 | 1190 | // If last message at load time is a sent message, this may not include everyone | |
| 1191 | 1191 | if (_fullCounterparts.length < 2 && (message?.recipients?.length ?? 0) > 1) { | |
| 1192 | 1192 | _fullCounterparts = message.recipients.map(r -> r.asBare().asString()).filter(id -> id != client.accountId()); | |
| 1193 | - | if (!_fullCounterparts.contains(message.senderId)) _fullCounterparts.push(message.senderId); | |
| 1193 | + | if (message.senderId != client.accountId() && !_fullCounterparts.contains(message.senderId)) _fullCounterparts.push(message.senderId); | |
| 1194 | 1194 | } | |
| 1195 | 1195 | return super.setLastMessage(message); | |
| 1196 | 1196 | } |
+24
-0
test/TestChat.hx
#
| ... | ... | @@ -1207,6 +1207,30 @@ class TestChat extends utest.Test { | |
| 1207 | 1207 | chat.sendMessage(builder, borogove.Chat.OutgoingE2EEPreference.NoE2EE); | |
| 1208 | 1208 | } | |
| 1209 | 1209 | ||
| 1210 | + | public function testCompatMultiDMParticipantsRecoveredFromOutgoingLastMessage(async: Async) { | |
| 1211 | + | final persistence = new Dummy(); | |
| 1212 | + | final client = new Client("me@example.com", persistence); | |
| 1213 | + | final chat = new borogove.Chat.DirectChat(client, client.stream, persistence, "multi@example.com"); | |
| 1214 | + | ||
| 1215 | + | final builder = new ChatMessageBuilder(); | |
| 1216 | + | builder.localId = "out-1"; | |
| 1217 | + | builder.sortId = "a0"; | |
| 1218 | + | builder.direction = MessageSent; | |
| 1219 | + | builder.from = JID.parse("me@example.com"); | |
| 1220 | + | builder.senderId = "me@example.com"; | |
| 1221 | + | builder.to = JID.parse("multi@example.com"); | |
| 1222 | + | builder.recipients = [JID.parse("bob@example.com"), JID.parse("carol@example.com")]; | |
| 1223 | + | builder.replyTo = [JID.parse("me@example.com")]; | |
| 1224 | + | ||
| 1225 | + | chat.setLastMessage(builder.build()).then(_ -> { | |
| 1226 | + | Assert.same(["bob@example.com", "carol@example.com"], chat._fullCounterparts); | |
| 1227 | + | chat.members().then(members -> { | |
| 1228 | + | final ids = members.map(m -> m.id); | |
| 1229 | + | Assert.same(["bob@example.com", "carol@example.com", "me@example.com"], ids); | |
| 1230 | + | async.done(); | |
| 1231 | + | }); | |
| 1232 | + | }); | |
| 1233 | + | } | |
| 1210 | 1234 | } | |
| 1211 | 1235 | ||
| 1212 | 1236 | @:access(borogove) |