From 52c3f1b7107fd29a29251014f1944c21fad0ddb8 Mon Sep 17 00:00:00 2001 From: Flo Lauber Date: Fri, 18 Jan 2013 19:49:47 -0500 Subject: [PATCH] use `Chat.type` in 's type attr in Send() Otherwise client.Send(..) cannot be used for MUC 'groupchat' messages. This might break code, if you're not setting `Chat`'s type slot and rely on `client.Send` set it to 'chat' by default --- xmpp.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xmpp.go b/xmpp.go index ef2107b..2378ef5 100644 --- a/xmpp.go +++ b/xmpp.go @@ -248,13 +248,12 @@ func (c *Client) Recv() (event interface{}, err error) { // Send sends message text. func (c *Client) Send(chat Chat) { - fmt.Fprintf(c.tls, ""+ + fmt.Fprintf(c.tls, ""+ "%s", - xmlEscape(chat.Remote), xmlEscape(chat.Text)) + xmlEscape(chat.Remote), xmlEscape(chat.Type), xmlEscape(chat.Text)) } // RFC 3920 C.1 Streams name space - type streamFeatures struct { XMLName xml.Name `xml:"http://etherx.jabber.org/streams features"` StartTLS tlsStartTLS