Support vCards for occupant JIDs

This commit is contained in:
Bohdan Horbeshko 2025-07-31 10:25:42 -04:00
parent ca75d38169
commit b2c4ade6b9

View file

@ -761,12 +761,24 @@ func handleGetVcardIq(s xmpp.Sender, iq *stanza.IQ, typ byte) {
return
}
toID, toOk, _ := toToID(iq.To)
toID, toOk, isGroup := toToID(iq.To)
if !toOk {
log.Error("Invalid IQ to")
return
}
if isGroup {
toJid, err := stanza.NewJid(iq.To)
if err != nil {
log.Error("Invalid to JID!")
return
}
if toJid.Resource != "" {
toID = session.GetMUCMemberIdByNickname(toID, toJid.Resource)
}
}
info, err := session.GetVcardInfo(toID)
if err != nil {
log.Error(err)