mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-11-19 16:13:54 -08:00
Adapt examples to new routing library for components
This commit is contained in:
committed by
Mickaël Rémond
parent
f0f0d5a285
commit
9b57809e9d
@@ -74,6 +74,7 @@ func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
|
||||
|
||||
playSCURL(p, url)
|
||||
setResponse := new(xmpp.ControlSetResponse)
|
||||
// FIXME: Broken
|
||||
reply := xmpp.IQ{PacketAttrs: xmpp.PacketAttrs{To: packet.From, Type: "result", Id: packet.Id}, Payload: []xmpp.IQPayload{setResponse}}
|
||||
_ = client.Send(reply)
|
||||
// TODO add Soundclound artist / title retrieval
|
||||
@@ -86,7 +87,7 @@ func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
|
||||
func sendUserTune(client *xmpp.Client, artist string, title string) {
|
||||
tune := xmpp.Tune{Artist: artist, Title: title}
|
||||
iq := xmpp.NewIQ("set", "", "", "usertune-1", "en")
|
||||
payload := xmpp.PubSub{Publish: xmpp.Publish{Node: "http://jabber.org/protocol/tune", Item: xmpp.Item{Tune: tune}}}
|
||||
payload := xmpp.PubSub{Publish: &xmpp.Publish{Node: "http://jabber.org/protocol/tune", Item: xmpp.Item{Tune: &tune}}}
|
||||
iq.AddPayload(&payload)
|
||||
_ = client.Send(iq)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user