mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 03:22:01 -08:00
Minor cleanup
This commit is contained in:
parent
24b8d7da3d
commit
d6bedfb033
@ -10,7 +10,7 @@ import (
|
||||
"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.
|
||||
type Client struct {
|
||||
// Store user defined options
|
||||
|
@ -41,10 +41,13 @@ func main() {
|
||||
reply := p.MakeError(xError)
|
||||
component.xmpp.Send(&reply)
|
||||
}
|
||||
|
||||
case xmpp.Message:
|
||||
fmt.Println("Received message:", p.Body)
|
||||
|
||||
case xmpp.Presence:
|
||||
fmt.Println("Received presence:", p.Type)
|
||||
|
||||
default:
|
||||
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 {
|
||||
t, err := d.Token()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user