forked from jshiffer/go-xmpp
fixed the xml tag unmarshalling for client messages
This commit is contained in:
parent
a25b82d0a4
commit
1dd8c2eeac
16
xmpp.go
16
xmpp.go
@ -119,7 +119,7 @@ func (c *Client) Close() error {
|
||||
|
||||
func (c *Client) init(user, passwd string) error {
|
||||
// For debugging: the following causes the plaintext of the connection to be duplicated to stdout.
|
||||
//c.p = xml.NewDecoder(tee{c.tls, os.Stdout});
|
||||
//c.p = xml.NewDecoder(tee{c.tls, os.Stdout})
|
||||
c.p = xml.NewDecoder(c.tls)
|
||||
|
||||
a := strings.SplitN(user, "@", 2)
|
||||
@ -315,16 +315,16 @@ type bindBind struct {
|
||||
|
||||
type clientMessage struct {
|
||||
XMLName xml.Name `xml:"jabber:client message"`
|
||||
From string `xml:",attr"`
|
||||
Id string `xml:",attr"`
|
||||
To string `xml:",attr"`
|
||||
Type string `xml:",attr"` // chat, error, groupchat, headline, or normal
|
||||
From string `xml:"from,attr"`
|
||||
Id string `xml:"id,attr"`
|
||||
To string `xml:"to,attr"`
|
||||
Type string `xml:"type,attr"` // chat, error, groupchat, headline, or normal
|
||||
|
||||
// These should technically be []clientText,
|
||||
// but string is much more convenient.
|
||||
Subject string
|
||||
Body string
|
||||
Thread string
|
||||
Subject string `xml:"subject"`
|
||||
Body string `xml:"body"`
|
||||
Thread string `xml:"thread"`
|
||||
}
|
||||
|
||||
type clientText struct {
|
||||
|
Loading…
Reference in New Issue
Block a user