aboutsummaryrefslogtreecommitdiff
path: root/xmpp/component.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/component.go')
-rw-r--r--xmpp/component.go9
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)