aboutsummaryrefslogtreecommitdiff
path: root/telegram/connect.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/connect.go')
-rw-r--r--telegram/connect.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/telegram/connect.go b/telegram/connect.go
index b1b8b10..6c88cd1 100644
--- a/telegram/connect.go
+++ b/telegram/connect.go
@@ -2,7 +2,6 @@ package telegram
import (
"github.com/pkg/errors"
- "strconv"
"time"
"dev.narayana.im/narayana/telegabber/xmpp/gateway"
@@ -159,7 +158,7 @@ func (c *Client) Connect(resource string) error {
}
gateway.SubscribeToTransport(c.xmpp, c.jid)
- gateway.SendPresence(c.xmpp, c.jid, gateway.SPStatus("Logged in as: "+c.Session.Login))
+ c.sendPresence(gateway.SPStatus("Logged in as: "+c.Session.Login))
}()
return nil
@@ -228,12 +227,8 @@ func (c *Client) Disconnect(resource string, quit bool) bool {
// we're offline (unsubscribe if logout)
for _, id := range c.cache.ChatsKeys() {
- gateway.SendPresence(
- c.xmpp,
- c.jid,
- gateway.SPFrom(strconv.FormatInt(id, 10)),
- gateway.SPType("unavailable"),
- )
+ args := gateway.SimplePresence(id, "unavailable")
+ c.sendPresence(args...)
}
c.close()