From d6bedfb03329d8d10eee809fbe3697446306368c Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Tue, 13 Feb 2018 22:07:15 +0100 Subject: [PATCH] Minor cleanup --- client.go | 2 +- cmd/xmpp_component/xmpp_component.go | 3 +++ iq.go | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 8db7249..aedc8a0 100644 --- a/client.go +++ b/client.go @@ -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 diff --git a/cmd/xmpp_component/xmpp_component.go b/cmd/xmpp_component/xmpp_component.go index 992ec1b..6dfe8de 100644 --- a/cmd/xmpp_component/xmpp_component.go +++ b/cmd/xmpp_component/xmpp_component.go @@ -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) } diff --git a/iq.go b/iq.go index fe3442a..cffbc31 100644 --- a/iq.go +++ b/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 {