mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 03:22:01 -08:00
Make demo component generic
This commit is contained in:
parent
bb1621364a
commit
24b8d7da3d
@ -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…
Reference in New Issue
Block a user