dc refactoring

This commit is contained in:
cx uname 2014-02-25 17:07:44 +04:00
parent 06e156e9aa
commit 19d89b28d8
1 changed files with 2 additions and 5 deletions

View File

@ -32,23 +32,22 @@ func main() {
)
start:
if Conn != nil {
time.Sleep(5 * time.Second)
log.Println("Conn check:", Conn.Close())
time.Sleep(5 * time.Second)
}
Conn, err = xmpp.Dial("xmpp.ru:5222", "hypnotoad", "xmpp.ru", "pass", "AllHailHypnotoad", nil)
if err != nil {
log.Println("Conn", err)
time.Sleep(5 * time.Second)
goto start
}
if err := Conn.SignalPresence("dnd", "is there some food in this world?", 12); err != nil {
log.Println("Signal", err)
time.Sleep(5 * time.Second)
goto start
}
if err := Conn.SendPresence(room+"/"+name, ""); err != nil {
log.Println("Presence", err)
time.Sleep(5 * time.Second)
goto start
}
@ -82,7 +81,6 @@ start:
case next = <-cs:
case <-time.After(65 * time.Second):
log.Println(Conn.Close(), "\n\t", "closed after 65 seconds of inactivity")
time.Sleep(5 * time.Second)
goto start
}
switch t := next.Value.(type) {
@ -102,7 +100,6 @@ start:
}
}
log.Println(Conn.Close(), "\n\t", "wtf am I doing here?")
time.Sleep(5 * time.Second)
goto start
}