mirror of
https://dev.narayana.im/narayana/telegabber.git
synced 2026-08-05 04:07:07 +00:00
Support vCards for occupant JIDs
This commit is contained in:
parent
ca75d38169
commit
b2c4ade6b9
1 changed files with 13 additions and 1 deletions
|
|
@ -761,12 +761,24 @@ func handleGetVcardIq(s xmpp.Sender, iq *stanza.IQ, typ byte) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
toID, toOk, _ := toToID(iq.To)
|
toID, toOk, isGroup := toToID(iq.To)
|
||||||
if !toOk {
|
if !toOk {
|
||||||
log.Error("Invalid IQ to")
|
log.Error("Invalid IQ to")
|
||||||
return
|
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)
|
info, err := session.GetVcardInfo(toID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue