diff --git a/src/xmpp_codec.rs b/src/xmpp_codec.rs index 8595dfca..b780a480 100644 --- a/src/xmpp_codec.rs +++ b/src/xmpp_codec.rs @@ -50,6 +50,7 @@ pub enum Packet { Error(Box), StreamStart(HashMap), Stanza(xml::Element), + Text(String), StreamEnd, } @@ -155,6 +156,8 @@ impl Encoder for XMPPCodec { }, Packet::Stanza(stanza) => write!(dst, "{}", stanza), + Packet::Text(text) => + write!(dst, "{}", xml::escape(&text)), // TODO: Implement all _ => Ok(()) }