Try to set online status.

This commit is contained in:
K. Isom 2021-04-20 13:53:36 -07:00
parent 1fc50a967d
commit a66471331e
1 changed files with 9 additions and 0 deletions
conn/xmpp

View File

@ -69,6 +69,7 @@ func runClient(cfg *xmpp.Config) {
logError(err)
return
}
SetOnline(cfg, client)
// If you pass the client to a connection manager, it will handle the reconnect policy
// for you automatically.
@ -76,3 +77,11 @@ func runClient(cfg *xmpp.Config) {
log.Print(cm.Run())
}
func SetOnline(cfg *xmpp.Config, client *xmpp.Client) {
pkt := stanza.NewPresence(stanza.Attrs{
From: cfg.Jid,
})
client.Send(pkt)
}