From 24b8d7da3d6ce3fdbae3f8c3ff419b42d62e9958 Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Fri, 26 Jan 2018 12:37:27 +0100 Subject: [PATCH] Make demo component generic --- cmd/xmpp_component/xmpp_component.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cmd/xmpp_component/xmpp_component.go b/cmd/xmpp_component/xmpp_component.go index 38840f0..992ec1b 100644 --- a/cmd/xmpp_component/xmpp_component.go +++ b/cmd/xmpp_component/xmpp_component.go @@ -6,16 +6,9 @@ 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"} + component := MyComponent{Name: "Test Component", Category: "gateway", Type: "service"} + component.xmpp = &xmpp.Component{Host: "service.localhost", Secret: "mypass"} component.xmpp.Connect("localhost:8888") for { @@ -97,7 +90,7 @@ func DiscoItems(c MyComponent, attrs xmpp.PacketAttrs, items *xmpp.DiscoItems) { if items.Node == "" { payload = xmpp.DiscoItems{ Items: []xmpp.DiscoItem{ - {Name: "test node", JID: "facebook.localhost", Node: "node1"}, + {Name: "test node", JID: "service.localhost", Node: "node1"}, }, } }