aboutsummaryrefslogtreecommitdiff
path: root/xmpp/handlers.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-01-06 00:04:22 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-01-06 00:04:22 +0300
commit077edae986f2229d263f978b7cf35ed88254c042 (patch)
tree01877034c1989565e2de30bce04d1c15eb06579e /xmpp/handlers.go
parentd48cb8b58682d3b9c5798913de35ae62dd20dd38 (diff)
Add keeponline option
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r--xmpp/handlers.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index 59d4c62..1b4f6a3 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -170,7 +170,9 @@ func handlePresence(s xmpp.Sender, p stanza.Presence) {
// destroy session
case "unsubscribed", "unsubscribe":
if session.Disconnect(fromJid.Resource, false) {
+ sessionLock.Lock()
delete(sessions, bareFromJid)
+ sessionLock.Unlock()
}
// go offline
case "unavailable", "error":