- go EventToXMPP(ps, xmpp_presence_events_chan_)
- go ReadFromUSocket(presence_socket_path_, newlinequeue)
- for {
- select {
- case e := <-newlinequeue:
- ParseSocketInputLine(e, ps) //, brn)
- case <-ticker.C:
- ps.Pub(TimeTick{time.Now().Unix()}, "publishjson")
- }
- }
+ if xmpperr == nil {
+ defer bot.StopBot()
+ go EventToXMPP(ps, xmpp_presence_events_chan_)
+ } else {
+ fmt.Println(xmpperr)
+ fmt.Println("XMPP Bot disabled")
+ }
+ go ReadFromUSocket(presence_socket_path_, newlinequeue)
+ ticker := time.NewTicker(time.Duration(7) * time.Minute)
+
+ for {
+ select {
+ case e := <-newlinequeue:
+ ParseSocketInputLine(e, ps) //, brn)
+ case <-ticker.C:
+ ps.Pub(TimeTick{time.Now().Unix()}, "publishjson")
+ }
+ }