From e871a899f0d2f3ded29e61bf31e7f6d186fa82e9 Mon Sep 17 00:00:00 2001 From: Chteufleur Date: Mon, 31 Oct 2016 22:18:31 +0100 Subject: [PATCH] Correct some misspell and unreachable code. --- configuration/configuration.go | 2 +- gateway/steam.go | 4 ---- xmpp/commands.go | 10 +++++----- xmpp/xmpp.go | 8 ++++---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/configuration/configuration.go b/configuration/configuration.go index b297c54..78ea2ed 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -51,7 +51,7 @@ func loadConfigFile() bool { if _, err := os.Stat(configFile); err == nil { // The config file exist if cfg.Load(configFile, MapConfig) == nil { - // And has been loaded succesfully + // And has been loaded successfully logger.Info.Println("Find configuration file at " + configFile) ret = true break diff --git a/gateway/steam.go b/gateway/steam.go index 7abb57e..799ea09 100644 --- a/gateway/steam.go +++ b/gateway/steam.go @@ -45,10 +45,6 @@ func (g *GatewayInfo) SteamRun() { g.mainSteam() logger.Info.Printf("[%s] Reach main method's end", g.XMPP_JID_Client) - return - g.Disconnect() - go g.XMPP_Disconnect() - g.Run() } func (g *GatewayInfo) mainSteam() { diff --git a/xmpp/commands.go b/xmpp/commands.go index dffad00..b618f62 100644 --- a/xmpp/commands.go +++ b/xmpp/commands.go @@ -232,11 +232,11 @@ func execCommandAdHoc(iq *xmpp.Iq) { } } if authCode != "" { - // Succeded + // Succeeded g := MapGatewayInfo[jidBareFrom] if g != nil { g.SetSteamAuthCode(authCode) - note.Value = "Command succeded !" + note.Value = "Command succeeded !" } else { note.Value = "Your are not registred. Please, register before sending Steam auth code." } @@ -256,7 +256,7 @@ func execCommandAdHoc(iq *xmpp.Iq) { if dbUser != nil { if dbUser.UpdateUser() { AddNewUser(dbUser.Jid, dbUser.SteamLogin, dbUser.SteamPwd, dbUser.Debug) - note.Value = "Command succeded !" + note.Value = "Command succeeded !" } else { note.Value = "Error append while executing command" } @@ -281,7 +281,7 @@ func execCommandAdHoc(iq *xmpp.Iq) { } } if message != "" { - // Succeded + // Succeeded for userJID, _ := range MapGatewayInfo { SendMessage(userJID, "", message) } @@ -329,7 +329,7 @@ func getUser(fields []xmpp.AdHocField, iq *xmpp.Iq) *database.DatabaseLine { } } if steamLogin != "" { - // Succeded + // Succeeded jidBareFrom := strings.SplitN(iq.From, "/", 2)[0] dbUser := new(database.DatabaseLine) dbUser.Jid = jidBareFrom diff --git a/xmpp/xmpp.go b/xmpp/xmpp.go index d27ea2f..3195469 100644 --- a/xmpp/xmpp.go +++ b/xmpp/xmpp.go @@ -65,8 +65,8 @@ func mainXMPP() { g := MapGatewayInfo[jidBareFrom] if g != nil { if jidBareTo == jid.Domain { - // Forward only if presence is for componant, in order to to not spam set presence on Steam - logger.Debug.Printf("Presence transfered to %s", jidBareFrom) + // Forward only if presence is for component, in order to to not spam set presence on Steam + logger.Debug.Printf("Presence transferred to %s", jidBareFrom) go g.ReceivedXMPP_Presence(v) } } else { @@ -79,7 +79,7 @@ func mainXMPP() { jidBareFrom := strings.SplitN(v.From, "/", 2)[0] g := MapGatewayInfo[jidBareFrom] if g != nil { - logger.Debug.Printf("Message transfered to %s", jidBareFrom) + logger.Debug.Printf("Message transferred to %s", jidBareFrom) go g.ReceivedXMPP_Message(v) } else { SendMessage(v.From, "", "Your are not registred. If you want to register, please, send an Ad-Hoc command.") @@ -92,7 +92,7 @@ func mainXMPP() { g := MapGatewayInfo[jidBareFrom] iqTreated := false if g != nil { - logger.Debug.Printf("Iq transfered to %s", jidBareFrom) + logger.Debug.Printf("Iq transferred to %s", jidBareFrom) iqTreated = g.ReceivedXMPP_IQ(v) }