From cb2af43fe300ad4ab345730b4cb57d16df3d8d2c Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Tue, 23 Jan 2018 08:55:15 +0100 Subject: [PATCH] Decode presence and message for components --- cmd/xmpp_component/xmpp_component.go | 7 +++++++ parser.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/cmd/xmpp_component/xmpp_component.go b/cmd/xmpp_component/xmpp_component.go index 4773ed1..a2f75ba 100644 --- a/cmd/xmpp_component/xmpp_component.go +++ b/cmd/xmpp_component/xmpp_component.go @@ -6,6 +6,13 @@ import ( "fluux.io/xmpp" ) +const ( + localUser = "admin@localhost" +) + +// TODO add webserver listener to support receiving message from facebook and replying +// Message will get to define localhost user and be routed only from local user + func main() { component := MyComponent{Name: "Facebook Gateway", Category: "gateway", Type: "facebook"} component.xmpp = &xmpp.Component{Host: "facebook.localhost", Secret: "mypass"} diff --git a/parser.go b/parser.go index aec306c..533f8a2 100644 --- a/parser.go +++ b/parser.go @@ -126,6 +126,10 @@ func decodeComponent(p *xml.Decoder, se xml.StartElement) (Packet, error) { switch se.Name.Local { case "handshake": return handshake.decode(p, se) + case "message": + return message.decode(p, se) + case "presence": + return presence.decode(p, se) case "iq": return iq.decode(p, se) default: