diff options
author | fiaxh <git@lightrise.org> | 2020-06-28 15:53:41 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-07-15 18:12:19 +0200 |
commit | 74f7fa897f9aec298eeadcfc7a7b971f06498858 (patch) | |
tree | b39e0151172ac6a1f0b7eee88a02916c73744d5a /xmpp-vala/src/core/stanza_writer.vala | |
parent | 8e3462b1b703cb504ee397fd5a849090ee377706 (diff) | |
download | dino-74f7fa897f9aec298eeadcfc7a7b971f06498858.tar.gz dino-74f7fa897f9aec298eeadcfc7a7b971f06498858.zip |
Add queue and resending to stream management
Diffstat (limited to 'xmpp-vala/src/core/stanza_writer.vala')
-rw-r--r-- | xmpp-vala/src/core/stanza_writer.vala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xmpp-vala/src/core/stanza_writer.vala b/xmpp-vala/src/core/stanza_writer.vala index ab51a948..51f0061f 100644 --- a/xmpp-vala/src/core/stanza_writer.vala +++ b/xmpp-vala/src/core/stanza_writer.vala @@ -14,6 +14,22 @@ public class StanzaWriter { yield write_data(node.to_xml().data); } + public async void write_nodes(StanzaNode node1, StanzaNode node2) throws XmlError { + var data1 = node1.to_xml().data; + var data2 = node2.to_xml().data; + + uint8[] concat = new uint8[data1.length + data2.length]; + int i = 0; + foreach (var datum in data1) { + concat[i++] = datum; + } + foreach (var datum in data2) { + concat[i++] = datum; + } + + yield write_data(concat); + } + public async void write(string s) throws XmlError { yield write_data(s.data); } |