mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 12:17:06 +00:00
Duplicate chat presences as following MUC member presences too
This commit is contained in:
parent
c6ca9c02c8
commit
71f59ee739
1 changed files with 22 additions and 1 deletions
|
|
@ -454,11 +454,32 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, o
|
||||||
gateway.SPPhoto(photo),
|
gateway.SPPhoto(photo),
|
||||||
gateway.SPImmed(gateway.SPImmed.Get(oldArgs)),
|
gateway.SPImmed(gateway.SPImmed.Get(oldArgs)),
|
||||||
}
|
}
|
||||||
newArgs = gateway.SPAppendFrom(newArgs, chatID)
|
|
||||||
if presenceType != "" {
|
if presenceType != "" {
|
||||||
newArgs = append(newArgs, gateway.SPType(presenceType))
|
newArgs = append(newArgs, gateway.SPType(presenceType))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.locks.mucCacheLock.Lock()
|
||||||
|
for mucId, state := range c.mucCache {
|
||||||
|
member, ok := state.Members[chatID]
|
||||||
|
if ok {
|
||||||
|
sMucId := strconv.FormatInt(mucId, 10)
|
||||||
|
newMucArgs := append(
|
||||||
|
newArgs,
|
||||||
|
gateway.SPFrom(sMucId),
|
||||||
|
gateway.SPResource(member.Nickname),
|
||||||
|
gateway.SPMUCAffiliation(member.Affiliation),
|
||||||
|
)
|
||||||
|
err := c.sendPresence(newMucArgs...)
|
||||||
|
if err != nil {
|
||||||
|
c.locks.mucCacheLock.Unlock()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.locks.mucCacheLock.Unlock()
|
||||||
|
|
||||||
|
newArgs = gateway.SPAppendFrom(newArgs, chatID)
|
||||||
|
|
||||||
return c.sendPresence(newArgs...)
|
return c.sendPresence(newArgs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue