Send real JID in more of presences

This commit is contained in:
Bohdan Horbeshko 2025-05-08 20:59:28 -04:00
parent 48cd525b8e
commit 6a8a96a4f4

View file

@ -459,6 +459,7 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, o
}
c.locks.mucCacheLock.Lock()
chatJid := strconv.FormatInt(chatID, 10) + "@" + gateway.Jid.Full()
for mucId, state := range c.mucCache {
member, ok := state.Members[chatID]
if ok {
@ -468,6 +469,7 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, o
gateway.SPFrom(sMucId),
gateway.SPResource(member.Nickname),
gateway.SPMUCAffiliation(member.Affiliation),
gateway.SPMUCJid(chatJid),
)
err := c.sendPresence(newMucArgs...)
if err != nil {
@ -615,6 +617,7 @@ func (c *Client) updateMUCsNickname(memberID int64, newNickname string) {
c.locks.mucCacheLock.Lock()
defer c.locks.mucCacheLock.Unlock()
realJid := strconv.FormatInt(memberID, 10) + "@" + gateway.Jid.Full()
for mucId, state := range c.mucCache {
oldMember, ok := state.Members[memberID]
if ok {
@ -638,6 +641,7 @@ func (c *Client) updateMUCsNickname(memberID int64, newNickname string) {
gateway.SPMUCAffiliation(oldMember.Affiliation),
gateway.SPMUCNick(newNickname),
gateway.SPMUCStatusCodes(unavailableStatusCodes),
gateway.SPMUCJid(realJid),
)
c.sendPresence(
gateway.SPFrom(sMucId),
@ -645,6 +649,7 @@ func (c *Client) updateMUCsNickname(memberID int64, newNickname string) {
gateway.SPImmed(true),
gateway.SPMUCAffiliation(oldMember.Affiliation),
gateway.SPMUCStatusCodes(availableStatusCodes),
gateway.SPMUCJid(realJid),
)
}
}