forked from jshiffer/go-xmpp
keep IQ struct unchange
This commit is contained in:
parent
65fd08aee2
commit
ef6a1a617c
12
xmpp.go
12
xmpp.go
@ -623,8 +623,7 @@ type IQ struct {
|
||||
From string
|
||||
To string
|
||||
Type string
|
||||
Query string
|
||||
QueryName xml.Name
|
||||
Query []byte
|
||||
}
|
||||
|
||||
// Recv waits to receive the next XMPP stanza.
|
||||
@ -668,8 +667,15 @@ func (c *Client) Recv() (stanza interface{}, err error) {
|
||||
return Chat{}, err
|
||||
}
|
||||
}
|
||||
if v.Query.XMLName.Local == "" {
|
||||
return IQ{ID: v.ID, From: v.From, To: v.To, Type: v.Type}, nil
|
||||
} else if res, err := xml.Marshal(v.Query); err != nil {
|
||||
// should never occur
|
||||
return Chat{}, err
|
||||
} else {
|
||||
return IQ{ID: v.ID, From: v.From, To: v.To, Type: v.Type,
|
||||
Query: v.Query.InnerXML, QueryName: v.Query.XMLName}, nil
|
||||
Query: res}, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user