mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 10:02:00 -08:00
Minor cleanup
This commit is contained in:
parent
24b8d7da3d
commit
d6bedfb033
@ -10,7 +10,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client is the main structure use to connect as a client on an XMPP
|
// Client is the main structure used to connect as a client on an XMPP
|
||||||
// server.
|
// server.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
// Store user defined options
|
// Store user defined options
|
||||||
|
@ -41,10 +41,13 @@ func main() {
|
|||||||
reply := p.MakeError(xError)
|
reply := p.MakeError(xError)
|
||||||
component.xmpp.Send(&reply)
|
component.xmpp.Send(&reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
case xmpp.Message:
|
case xmpp.Message:
|
||||||
fmt.Println("Received message:", p.Body)
|
fmt.Println("Received message:", p.Body)
|
||||||
|
|
||||||
case xmpp.Presence:
|
case xmpp.Presence:
|
||||||
fmt.Println("Received presence:", p.Type)
|
fmt.Println("Received presence:", p.Type)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fmt.Println("ignoring packet:", packet)
|
fmt.Println("ignoring packet:", packet)
|
||||||
}
|
}
|
||||||
|
3
iq.go
3
iq.go
@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO support ability to put Raw payload
|
TODO support ability to put Raw payload inside IQ
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@ -45,6 +45,7 @@ func (x *Err) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check subelements to extract error text and reason (from local namespace).
|
||||||
for {
|
for {
|
||||||
t, err := d.Token()
|
t, err := d.Token()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user