mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-10-22 12:35:36 -07:00
Makes parsing of inner IQ XML generic
This commit is contained in:
@@ -19,9 +19,11 @@ func main() {
|
||||
|
||||
switch p := packet.(type) {
|
||||
case xmpp.IQ:
|
||||
switch p.Payload.(type) {
|
||||
case *xmpp.Query:
|
||||
fmt.Println("Received query:", p.Type)
|
||||
switch inner := p.Payload.(type) {
|
||||
case *xmpp.Node:
|
||||
fmt.Println("Node:", inner.XMLName.Space, inner.XMLName.Local)
|
||||
default:
|
||||
fmt.Println("default")
|
||||
}
|
||||
default:
|
||||
fmt.Println("Packet unhandled packet:", packet)
|
||||
|
Reference in New Issue
Block a user