Fix broken tests
This commit is contained in:
parent
b3c11fb151
commit
20c2c44941
|
@ -21,7 +21,7 @@ func main() {
|
||||||
|
|
||||||
switch p := packet.(type) {
|
switch p := packet.(type) {
|
||||||
case xmpp.IQ:
|
case xmpp.IQ:
|
||||||
switch inner := p.Payload.(type) {
|
switch inner := p.Payload[0].(type) {
|
||||||
case *xmpp.Node:
|
case *xmpp.Node:
|
||||||
fmt.Printf("%q\n", inner)
|
fmt.Printf("%q\n", inner)
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ func processMessage(client *xmpp.Client, p *mpg123.Player, packet *xmpp.Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
|
func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
|
||||||
switch payload := packet.Payload.(type) {
|
switch payload := packet.Payload[0].(type) {
|
||||||
// We support IOT Control IQ
|
// We support IOT Control IQ
|
||||||
case *iot.ControlSet:
|
case *iot.ControlSet:
|
||||||
var url string
|
var url string
|
||||||
|
@ -76,7 +76,7 @@ func processIq(client *xmpp.Client, p *mpg123.Player, packet *xmpp.IQ) {
|
||||||
|
|
||||||
playSCURL(p, url)
|
playSCURL(p, url)
|
||||||
setResponse := new(iot.ControlSetResponse)
|
setResponse := new(iot.ControlSetResponse)
|
||||||
reply := xmpp.IQ{PacketAttrs: xmpp.PacketAttrs{To: packet.From, Type: "result", Id: packet.Id}, Payload: setResponse}
|
reply := xmpp.IQ{PacketAttrs: xmpp.PacketAttrs{To: packet.From, Type: "result", Id: packet.Id}, Payload: []xmpp.IQPayload{setResponse}}
|
||||||
client.Send(reply.XMPPFormat())
|
client.Send(reply.XMPPFormat())
|
||||||
// TODO add Soundclound artist / title retrieval
|
// TODO add Soundclound artist / title retrieval
|
||||||
sendUserTune(client, "Radiohead", "Spectre")
|
sendUserTune(client, "Radiohead", "Spectre")
|
||||||
|
|
Loading…
Reference in a new issue