Make demo component generic

disco_info_form
Mickael Remond 6 years ago
parent bb1621364a
commit 24b8d7da3d
No known key found for this signature in database
GPG Key ID: E6F6045D79965AA3

@ -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"},
},
}
}

Loading…
Cancel
Save