mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 04:07:07 +00:00
Send 170 status code when joining supergroups (assuming they are public and basic groups are not)
This commit is contained in:
parent
b1a67f6f4e
commit
5ec8eab64b
1 changed files with 6 additions and 1 deletions
|
|
@ -695,6 +695,7 @@ func (c *Client) sendMUCStatuses(chatID int64) {
|
|||
}
|
||||
}
|
||||
|
||||
// achtung: assuming a locked mucState context
|
||||
func (c *Client) updateMUCOccupants(mucState *MUCState, chatID int64, members []*client.ChatMember) {
|
||||
sChatId := gateway.MUCNODE(chatID)
|
||||
myNickname := "me"
|
||||
|
|
@ -738,6 +739,10 @@ func (c *Client) updateMUCOccupants(mucState *MUCState, chatID int64, members []
|
|||
}
|
||||
|
||||
// according to the spec, own occupant entry should be sent the last
|
||||
selfStatusCodes := []uint16{100, 110, 210}
|
||||
if chat != nil && chat.Type.ChatTypeType() == client.TypeChatTypeSupergroup {
|
||||
selfStatusCodes = append(selfStatusCodes, 170)
|
||||
}
|
||||
c.sendPresence(
|
||||
gateway.SPFrom(sChatId),
|
||||
gateway.SPResource(myNickname),
|
||||
|
|
@ -745,7 +750,7 @@ func (c *Client) updateMUCOccupants(mucState *MUCState, chatID int64, members []
|
|||
gateway.SPMUCAffiliation(myAffiliation),
|
||||
gateway.SPMUCRole(myRole),
|
||||
gateway.SPMUCJid(myJid),
|
||||
gateway.SPMUCStatusCodes([]uint16{100, 110, 210}),
|
||||
gateway.SPMUCStatusCodes(selfStatusCodes),
|
||||
gateway.SPToJids(toJids),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue