diff --git a/xmpp.go b/xmpp.go index e86eec4..889b68b 100644 --- a/xmpp.go +++ b/xmpp.go @@ -553,6 +553,14 @@ func (c *Client) SendOrg(org string) (n int, err error) { return fmt.Fprint(c.conn, org) } +// SendHtml sends the message as HTML as defined by XEP-0071 +func (c *Client) SendHtml(chat Chat) (n int, err error) { + return fmt.Fprintf(c.conn, ""+ + "%s"+ + "%s", + xmlEscape(chat.Remote), xmlEscape(chat.Type), xmlEscape(chat.Text), chat.Text) +} + // RFC 3920 C.1 Streams name space type streamFeatures struct { XMLName xml.Name `xml:"http://etherx.jabber.org/streams features"`