mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-12-07 16:03:42 -08:00
compress iq checking in component
This commit is contained in:
@@ -55,11 +55,7 @@ func handleMessage(_ xmpp.Sender, p xmpp.Packet) {
|
|||||||
func discoInfo(c xmpp.Sender, p xmpp.Packet, opts xmpp.ComponentOptions) {
|
func discoInfo(c xmpp.Sender, p xmpp.Packet, opts xmpp.ComponentOptions) {
|
||||||
// Type conversion & sanity checks
|
// Type conversion & sanity checks
|
||||||
iq, ok := p.(xmpp.IQ)
|
iq, ok := p.(xmpp.IQ)
|
||||||
if !ok {
|
if !ok || iq.Type != "get" {
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if iq.Type != "get" {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,11 +86,7 @@ func discoInfo(c xmpp.Sender, p xmpp.Packet, opts xmpp.ComponentOptions) {
|
|||||||
func discoItems(c xmpp.Sender, p xmpp.Packet) {
|
func discoItems(c xmpp.Sender, p xmpp.Packet) {
|
||||||
// Type conversion & sanity checks
|
// Type conversion & sanity checks
|
||||||
iq, ok := p.(xmpp.IQ)
|
iq, ok := p.(xmpp.IQ)
|
||||||
if !ok {
|
if !ok || iq.Type != "get" {
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if iq.Type != "get" {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user