diff --git a/processStanzas.go b/processStanzas.go index 66fa134..81a9dbb 100644 --- a/processStanzas.go +++ b/processStanzas.go @@ -24,7 +24,7 @@ func processStanzas(client *xmpp.Client, muc string, mucNick string, feeds []str // Check for room mention of the bots nick if the the message type is groupchat. if v.Type == "groupchat" { // Leave if option quiet is set. - if quiet == true { + if quiet { break } // Get first word of the message and transform it to lower case. @@ -178,7 +178,7 @@ func processStanzas(client *xmpp.Client, muc string, mucNick string, feeds []str if v.Type == "get" { // Reply to disco#info requests according to https://xmpp.org/extensions/xep-0030.html. if strings.Contains(string(v.Query), - "") == true { + "") { _, err := client.RawInformation(client.JID(), v.From, v.ID, "result", ""+ ""+ @@ -186,7 +186,7 @@ func processStanzas(client *xmpp.Client, muc string, mucNick string, feeds []str if err != nil { log.Fatal("Error: Failed to reply to disco#info:", err) } - } else if strings.Contains(string(v.Query), "") == true { + } else if strings.Contains(string(v.Query), "") { // Reply to pings. _, err := client.RawInformation(client.JID(), v.From, v.ID, "result", "") if err != nil { diff --git a/sendPings.go b/sendPings.go index e2077b9..06ad4c5 100644 --- a/sendPings.go +++ b/sendPings.go @@ -28,15 +28,15 @@ func pingMUC(client *xmpp.Client, botJid string, muc string, mucNick string) { pingReceived = false // Check for result IQ as long as there was no reply yet. - for (time.Since(pingSent).Seconds() < 10.0) && (pingReceived == false) { + for (time.Since(pingSent).Seconds() < 10.0) && !pingReceived { time.Sleep(1 * time.Second) - if pingReceived == true { + if pingReceived { break } } // Quit if no ping reply was received. - if pingReceived == false { + if !pingReceived { log.Fatal("MUC not available. pingMUC") } }