aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/message/stanza.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/message/stanza.vala')
-rw-r--r--xmpp-vala/src/module/message/stanza.vala6
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);