mirror of
https://github.com/tinode/chat.git
synced 2026-05-07 20:12:42 +00:00
In handleLeaveReq, remove session subscriptions directly.
Instead of writing to Session.detach.
This commit is contained in:
+1
-1
@@ -720,7 +720,7 @@ func (t *Topic) handleLeaveRequest(msg *ClientComMessage, sess *Session) {
|
||||
// User wants to leave without unsubscribing.
|
||||
if pssd, _ := t.remSession(sess, asUid); pssd != nil {
|
||||
if !sess.isProxy() {
|
||||
sess.detach <- t.name
|
||||
sess.delSub(t.name)
|
||||
}
|
||||
if pssd.isChanSub != asChan {
|
||||
// Cannot address non-channel subscription as channel and vice versa.
|
||||
|
||||
@@ -139,7 +139,7 @@ func (t *Topic) handleProxyLeaveRequest(msg *ClientComMessage, killTimer *time.T
|
||||
// and we won't be able to find and remove it by its sid.
|
||||
pssd, result := t.remSession(msg.sess, asUid)
|
||||
if result {
|
||||
msg.sess.detach <- t.name
|
||||
msg.sess.delSub(t.name)
|
||||
}
|
||||
if !msg.init {
|
||||
// Explicitly specify the uid because the master multiplex session needs to know which
|
||||
|
||||
Reference in New Issue
Block a user