From cbdf478ba76b7c62f6ac8c2f6343f6cfa0f8d8bc Mon Sep 17 00:00:00 2001 From: Specode <0x0000e000@gmail.com> Date: Wed, 30 Oct 2013 17:13:02 +0800 Subject: [PATCH 1/2] clientMessage add ",any" tag, use for hasn't matched element --- xmpp.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xmpp.go b/xmpp.go index 3f9f527..2a705cb 100644 --- a/xmpp.go +++ b/xmpp.go @@ -367,6 +367,7 @@ type Chat struct { Remote string Type string Text string + Other []string } type Presence struct { @@ -385,7 +386,7 @@ func (c *Client) Recv() (event interface{}, err error) { } switch v := val.(type) { case *clientMessage: - return Chat{v.From, v.Type, v.Body}, nil + return Chat{v.From, v.Type, v.Body, v.Other}, nil case *clientPresence: return Presence{v.From, v.To, v.Type, v.Show}, nil } @@ -488,6 +489,11 @@ type clientMessage struct { Subject string `xml:"subject"` Body string `xml:"body"` Thread string `xml:"thread"` + + Other []string `xml:",any"` + + // // Any hasn't matched element + // Other string `xml:",any"` } type clientText struct { From 64821d5df97100c4e61c60280d65d60a4fd623d1 Mon Sep 17 00:00:00 2001 From: Specode <0x0000e000@gmail.com> Date: Wed, 30 Oct 2013 17:14:11 +0800 Subject: [PATCH 2/2] clientMessage add ",any" tag, use for hasn't matched element --- xmpp.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xmpp.go b/xmpp.go index 2a705cb..52c1e66 100644 --- a/xmpp.go +++ b/xmpp.go @@ -490,10 +490,8 @@ type clientMessage struct { Body string `xml:"body"` Thread string `xml:"thread"` + // Any hasn't matched element Other []string `xml:",any"` - - // // Any hasn't matched element - // Other string `xml:",any"` } type clientText struct {