mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 03:22:01 -08:00
Fix broken tests
This commit is contained in:
parent
b3c11fb151
commit
20c2c44941
@ -21,7 +21,7 @@ func main() {
|
||||
|
||||
switch p := packet.(type) {
|
||||
case xmpp.IQ:
|
||||
switch inner := p.Payload.(type) {
|
||||
switch inner := p.Payload[0].(type) {
|
||||
case *xmpp.Node:
|
||||
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) {
|
||||
switch payload := packet.Payload.(type) {
|
||||
switch payload := packet.Payload[0].(type) {
|
||||
// We support IOT Control IQ
|
||||
case *iot.ControlSet:
|
||||
var url string
|
||||
@ -76,7 +76,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: setResponse}
|
||||
reply := xmpp.IQ{PacketAttrs: xmpp.PacketAttrs{To: packet.From, Type: "result", Id: packet.Id}, Payload: []xmpp.IQPayload{setResponse}}
|
||||
client.Send(reply.XMPPFormat())
|
||||
// TODO add Soundclound artist / title retrieval
|
||||
sendUserTune(client, "Radiohead", "Spectre")
|
||||
|
Loading…
Reference in New Issue
Block a user