fix iq - get after refactoring routing on #55

This commit is contained in:
genofire 2019-06-20 11:36:22 +02:00 committed by Mickaël Rémond
parent 1a7aa94bae
commit 44681e8053

View file

@ -59,6 +59,10 @@ func discoInfo(c xmpp.Sender, p xmpp.Packet, opts xmpp.ComponentOptions) {
return return
} }
if iq.Type != "get" {
return
}
iqResp := xmpp.NewIQ("result", iq.To, iq.From, iq.Id, "en") iqResp := xmpp.NewIQ("result", iq.To, iq.From, iq.Id, "en")
identity := xmpp.Identity{ identity := xmpp.Identity{
Name: opts.Name, Name: opts.Name,
@ -90,12 +94,12 @@ func discoItems(c xmpp.Sender, p xmpp.Packet) {
return return
} }
discoItems, ok := iq.Payload.(*xmpp.DiscoItems) if iq.Type != "get" {
if !ok {
return return
} }
if iq.Type != "get" { discoItems, ok := iq.Payload.(*xmpp.DiscoItems)
if !ok {
return return
} }