1
0
Fork 0

Correct some misspell and unreachable code.

This commit is contained in:
Chteufleur 2016-10-31 22:18:31 +01:00
parent 1743a46eea
commit e871a899f0
4 changed files with 10 additions and 14 deletions

View File

@ -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

View File

@ -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() {

View File

@ -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

View File

@ -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)
}