mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 12:17:06 +00:00
Kick from MUCs on transport shutdown
This commit is contained in:
parent
0b1e204912
commit
863c5afa91
1 changed files with 15 additions and 0 deletions
|
|
@ -234,6 +234,21 @@ func (c *Client) Disconnect(resource string, quit bool) bool {
|
|||
c.sendPresence(args...)
|
||||
}
|
||||
|
||||
if c.Session.MUC {
|
||||
c.locks.mucCacheLock.Lock()
|
||||
for chatID := range c.mucCache {
|
||||
c.sendPresence(
|
||||
gateway.SPFrom(gateway.MUCNODE(chatID)),
|
||||
gateway.SPResource(c.GetMUCNickname(0)),
|
||||
gateway.SPType("unavailable"),
|
||||
gateway.SPMUCAffiliation("none"),
|
||||
gateway.SPMUCRole("none"),
|
||||
gateway.SPMUCStatusCodes([]uint16{110, 332}),
|
||||
)
|
||||
}
|
||||
c.locks.mucCacheLock.Unlock()
|
||||
}
|
||||
|
||||
c.close()
|
||||
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in a new issue