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
clone should clone attributes
Stephen Paul Weber
2026-11-09T16:18:06Zmutating the new object should not mutate parent or vice versa, not even for attributes.
Semantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(2 files skipped: unsupported file type)
+2
-1
borogove/Stanza.hx
#
| ... | ... | @@ -227,7 +227,8 @@ class Stanza { | |
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | 229 | public function clone():Stanza { | |
| 230 | - | var clone = new Stanza(this.name, this.attr); | |
| 230 | + | var clone = new Stanza(this.name); | |
| 231 | + | for (key => value in this.attr) clone.attr.set(key, value); | |
| 231 | 232 | for (child in children) { | |
| 232 | 233 | clone.addDirectChild(switch(child) { | |
| 233 | 234 | case Element(c): Element(c.clone()); |
+8
-0
test/TestStanza.hx
#
| ... | ... | @@ -68,10 +68,18 @@ class TestStanza extends utest.Test { | |
| 68 | 68 | .tag("child") | |
| 69 | 69 | .text("original") | |
| 70 | 70 | .up(); | |
| 71 | + | s.attr.set("original", "yes"); | |
| 71 | 72 | ||
| 72 | 73 | final cloned = s.clone(); | |
| 73 | 74 | Assert.equals(s.serialize(), cloned.serialize()); | |
| 74 | 75 | ||
| 76 | + | s.attr.set("original", "modified"); | |
| 77 | + | cloned.attr.set("cloned", "yes"); | |
| 78 | + | Assert.equals("modified", s.attr.get("original")); | |
| 79 | + | Assert.equals("yes", cloned.attr.get("original")); | |
| 80 | + | Assert.isNull(s.attr.get("cloned")); | |
| 81 | + | Assert.equals("yes", cloned.attr.get("cloned")); | |
| 82 | + | ||
| 75 | 83 | // Modify original | |
| 76 | 84 | s.allTags("child")[0].children = []; | |
| 77 | 85 | s.allTags("child")[0].text("modified"); |