Several changes

This commit is contained in:
2026-01-30 10:40:38 +00:00
parent 1ef42695f0
commit 92b01844c4
9 changed files with 155 additions and 15 deletions

27
xmpp-vcard.go Normal file
View File

@@ -0,0 +1,27 @@
package main
// Implementation of XEP-0054
// https://xmpp.org/extensions/xep-0054.html
import (
"encoding/xml"
"gosrc.io/xmpp/stanza"
)
type VCard struct {
XMLName xml.Name `xml:"vcard-temp vCard"`
Photo Photo `xml:"PHOTO"`
}
func (v *VCard) Namespace() string {
return v.XMLName.Space
}
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{})
}