mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 19:42:00 -08:00
Decode presence and message for components
This commit is contained in:
parent
57cc0a25ac
commit
cb2af43fe3
@ -6,6 +6,13 @@ import (
|
|||||||
"fluux.io/xmpp"
|
"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() {
|
func main() {
|
||||||
component := MyComponent{Name: "Facebook Gateway", Category: "gateway", Type: "facebook"}
|
component := MyComponent{Name: "Facebook Gateway", Category: "gateway", Type: "facebook"}
|
||||||
component.xmpp = &xmpp.Component{Host: "facebook.localhost", Secret: "mypass"}
|
component.xmpp = &xmpp.Component{Host: "facebook.localhost", Secret: "mypass"}
|
||||||
|
@ -126,6 +126,10 @@ func decodeComponent(p *xml.Decoder, se xml.StartElement) (Packet, error) {
|
|||||||
switch se.Name.Local {
|
switch se.Name.Local {
|
||||||
case "handshake":
|
case "handshake":
|
||||||
return handshake.decode(p, se)
|
return handshake.decode(p, se)
|
||||||
|
case "message":
|
||||||
|
return message.decode(p, se)
|
||||||
|
case "presence":
|
||||||
|
return presence.decode(p, se)
|
||||||
case "iq":
|
case "iq":
|
||||||
return iq.decode(p, se)
|
return iq.decode(p, se)
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user