forked from jshiffer/go-xmpp
clientMessage add ",any" tag, use for hasn't matched element
This commit is contained in:
parent
ba140e5eb7
commit
cbdf478ba7
8
xmpp.go
8
xmpp.go
@ -367,6 +367,7 @@ type Chat struct {
|
|||||||
Remote string
|
Remote string
|
||||||
Type string
|
Type string
|
||||||
Text string
|
Text string
|
||||||
|
Other []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Presence struct {
|
type Presence struct {
|
||||||
@ -385,7 +386,7 @@ func (c *Client) Recv() (event interface{}, err error) {
|
|||||||
}
|
}
|
||||||
switch v := val.(type) {
|
switch v := val.(type) {
|
||||||
case *clientMessage:
|
case *clientMessage:
|
||||||
return Chat{v.From, v.Type, v.Body}, nil
|
return Chat{v.From, v.Type, v.Body, v.Other}, nil
|
||||||
case *clientPresence:
|
case *clientPresence:
|
||||||
return Presence{v.From, v.To, v.Type, v.Show}, nil
|
return Presence{v.From, v.To, v.Type, v.Show}, nil
|
||||||
}
|
}
|
||||||
@ -488,6 +489,11 @@ type clientMessage struct {
|
|||||||
Subject string `xml:"subject"`
|
Subject string `xml:"subject"`
|
||||||
Body string `xml:"body"`
|
Body string `xml:"body"`
|
||||||
Thread string `xml:"thread"`
|
Thread string `xml:"thread"`
|
||||||
|
|
||||||
|
Other []string `xml:",any"`
|
||||||
|
|
||||||
|
// // Any hasn't matched element
|
||||||
|
// Other string `xml:",any"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type clientText struct {
|
type clientText struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user