From ca882fd13ad4f366a13908b3e979c0fbbbb69214 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 27 May 2017 16:25:59 +0100 Subject: [PATCH] prevent the presence plugin from generating an illegal show element --- src/plugins/presence.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/presence.rs b/src/plugins/presence.rs index 147ac28e..e63b5b3e 100644 --- a/src/plugins/presence.rs +++ b/src/plugins/presence.rs @@ -81,13 +81,13 @@ impl PresencePlugin { .build(); stanza.append_child(elem); } - let mut elem = Element::builder("show") - .ns(ns::CLIENT) - .build(); if show != Show::Available { + let mut elem = Element::builder("show") + .ns(ns::CLIENT) + .build(); elem.append_text_node(show.to_string()); + stanza.append_child(elem); } - stanza.append_child(elem); self.proxy.send(stanza); } Ok(())