diff options
author | fiaxh <git@lightrise.org> | 2024-11-02 22:24:59 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2024-11-15 14:40:08 -0600 |
commit | 79f792e090330a05753f9edb27332a946eb0840d (patch) | |
tree | 5a6f1ad3ac0af0beea44ca9e83e7a9b052263025 /xmpp-vala/src/module/message/stanza.vala | |
parent | aaf4542e6208460c305db4be36b15dc832ddc95a (diff) | |
download | dino-79f792e090330a05753f9edb27332a946eb0840d.tar.gz dino-79f792e090330a05753f9edb27332a946eb0840d.zip |
Fix and improve stateless file-sharing
Diffstat (limited to 'xmpp-vala/src/module/message/stanza.vala')
-rw-r--r-- | xmpp-vala/src/module/message/stanza.vala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmpp-vala/src/module/message/stanza.vala b/xmpp-vala/src/module/message/stanza.vala index 053c44dd..cb07ab2a 100644 --- a/xmpp-vala/src/module/message/stanza.vala +++ b/xmpp-vala/src/module/message/stanza.vala @@ -15,13 +15,17 @@ public class MessageStanza : Xmpp.Stanza { public bool rerun_parsing = false; private ArrayList<MessageFlag> flags = new ArrayList<MessageFlag>(); - public string body { + public string? body { get { StanzaNode? body_node = stanza.get_subnode(NODE_BODY); return body_node == null ? null : body_node.get_string_content(); } set { StanzaNode? body_node = stanza.get_subnode(NODE_BODY); + if (value == null) { + if (body_node != null) stanza.sub_nodes.remove(body_node); + return; + } if (body_node == null) { body_node = new StanzaNode.build(NODE_BODY); stanza.put_node(body_node); |