diff options
author | bodqhrohro <bodqhrohro@gmail.com> | 2019-11-29 03:51:41 +0300 |
---|---|---|
committer | bodqhrohro <bodqhrohro@gmail.com> | 2019-11-29 03:51:41 +0300 |
commit | dbe87fafa8fb3c38d6cb22ac335cc76b70b607a6 (patch) | |
tree | 784f16c7e27444c03b865e1f4c03aadac1f18bf8 /xmpp/component.go | |
parent | bcf222b53db2199cb6c784ac8c5b7105d794b6c9 (diff) |
Handle updates of user status
Diffstat (limited to 'xmpp/component.go')
-rw-r--r-- | xmpp/component.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/xmpp/component.go b/xmpp/component.go index c0b4a23..57d9c7b 100644 --- a/xmpp/component.go +++ b/xmpp/component.go @@ -17,7 +17,6 @@ const pollingInterval time.Duration = 1e7 var tgConf config.TelegramConfig var sessions map[string]*telegram.Client -var queue gateway.Queue var db persistence.SessionsYamlDB // NewComponent starts a new component and wraps it in @@ -30,8 +29,6 @@ func NewComponent(conf config.XMPPConfig, tc config.TelegramConfig) (*xmpp.Strea return nil, nil, err } - queue = make(gateway.Queue) - tgConf = tc options := xmpp.ComponentOptions{ @@ -69,7 +66,7 @@ func heartbeat(component *xmpp.Component) { for jid := range sessions { for { - err = gateway.SendPresence(component, queue, jid, probeType) + err = gateway.SendPresence(component, jid, probeType) if err == nil { break } @@ -80,12 +77,12 @@ func heartbeat(component *xmpp.Component) { log.Info("Starting heartbeat queue") for { - for key, presence := range queue { + for key, presence := range gateway.Queue { err = component.Send(presence) if err != nil { gateway.LogBadPresence(err, presence) } else { - delete(queue, key) + delete(gateway.Queue, key) } } time.Sleep(60e9) |