forked from sunglocto/lambda
28 lines
505 B
Go
28 lines
505 B
Go
|
|
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{})
|
||
|
|
}
|