Files
lambda/xmpp-vcard.go

33 lines
646 B
Go
Raw Normal View History

2026-01-30 10:40:38 +00:00
package main
// Implementation of XEP-0054
// https://xmpp.org/extensions/xep-0054.html
import (
"encoding/xml"
"gosrc.io/xmpp/stanza"
)
type VCard struct {
2026-01-30 15:56:58 +00:00
XMLName xml.Name `xml:"vcard-temp vCard"`
Photo Photo `xml:"PHOTO"`
2026-01-30 13:29:53 +00:00
ResultSet *stanza.ResultSet `xml:"set,omitempty"`
2026-01-30 10:40:38 +00:00
}
func (v *VCard) Namespace() string {
return v.XMLName.Space
}
2026-01-30 13:29:53 +00:00
func (v *VCard) GetSet() *stanza.ResultSet {
return v.ResultSet
}
2026-01-30 10:40:38 +00:00
type Photo struct {
Type string `xml:"TYPE"`
Binval string `xml:"BINVAL"`
}
func init() {
stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{Space: "vcard-temp", Local: "vCard"}, VCard{})
}