mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-10-07 16:51:47 +00:00
Avoid a delay when adding a new resource
This commit is contained in:
parent
535423398a
commit
220083df74
1 changed files with 7 additions and 5 deletions
|
|
@ -2410,18 +2410,20 @@ func (c *Client) roster(resource string) {
|
||||||
if _, ok := c.resources[resource]; ok {
|
if _, ok := c.resources[resource]; ok {
|
||||||
c.locks.resourcesLock.Unlock()
|
c.locks.resourcesLock.Unlock()
|
||||||
return // we know it
|
return // we know it
|
||||||
|
} else if resource != "" {
|
||||||
|
c.resources[resource] = true
|
||||||
}
|
}
|
||||||
c.locks.resourcesLock.Unlock()
|
c.locks.resourcesLock.Unlock()
|
||||||
|
|
||||||
log.Warnf("Sending roster for %v", resource)
|
log.Warnf("Sending roster for %v", resource)
|
||||||
|
|
||||||
|
go func() {
|
||||||
for _, chat := range c.cache.OwnChatsKeys() {
|
for _, chat := range c.cache.OwnChatsKeys() {
|
||||||
c.ProcessStatusUpdate(chat, "", "", true)
|
c.ProcessStatusUpdate(chat, "", "", true)
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
c.sendPresence(gateway.SPStatus("Logged in as: " + c.Session.Login))
|
c.sendPresence(gateway.SPStatus("Logged in as: " + c.Session.Login))
|
||||||
|
|
||||||
c.addResource(resource)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get last messages from specified chat
|
// get last messages from specified chat
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue