From 58077b314af59cbe76112ca55d1a530ce53f2a4a Mon Sep 17 00:00:00 2001 From: ThomasBS Date: Sun, 11 Jan 2015 03:43:24 +0100 Subject: [PATCH] Add ability to send message as html --- xmpp.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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"`