git » sdk » commit baa6311

Helper to add many children at once from a list

author Stephen Paul Weber
2023-09-27 18:12:52 UTC
committer Stephen Paul Weber
2023-09-27 18:12:52 UTC
parent 2cd3ba3e87201bcf1c29e99bdd1303926196efb4

Helper to add many children at once from a list

xmpp/Stanza.hx +7 -0

diff --git a/xmpp/Stanza.hx b/xmpp/Stanza.hx
index c6121af..261058d 100644
--- a/xmpp/Stanza.hx
+++ b/xmpp/Stanza.hx
@@ -125,6 +125,13 @@ class Stanza implements NodeInterface {
 		return this;
 	}
 
+	public function addChildren(children:Iterable<Stanza>) {
+		for (child in children) {
+			addChild(child);
+		}
+		return this;
+	}
+
 	public function addChild(stanza:Stanza) {
 		this.last_added.children.push(Element(stanza));
 		return this;