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