Implements send / send raw

This commit is contained in:
Mickael Remond
2018-01-26 09:55:39 +01:00
parent 2cd8eed765
commit ad6e09a0f6
4 changed files with 39 additions and 8 deletions

View File

@@ -77,7 +77,7 @@ func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
playSCURL(p, url)
setResponse := new(iot.ControlSetResponse)
reply := xmpp.IQ{PacketAttrs: xmpp.PacketAttrs{To: packet.From, Type: "result", Id: packet.Id}, Payload: []xmpp.IQPayload{setResponse}}
client.Send(reply.XMPPFormat())
client.SendRaw(reply.XMPPFormat())
// TODO add Soundclound artist / title retrieval
sendUserTune(client, "Radiohead", "Spectre")
default:
@@ -87,7 +87,7 @@ func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
func sendUserTune(client *xmpp.Client, artist string, title string) {
tune := pep.Tune{Artist: artist, Title: title}
client.Send(tune.XMPPFormat())
client.SendRaw(tune.XMPPFormat())
}
func playSCURL(p *mpg123.Player, rawURL string) {