forked from sunglocto/lambda
Several changes
This commit is contained in:
27
xmpp-vcard.go
Normal file
27
xmpp-vcard.go
Normal 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{})
|
||||
}
|
||||
Reference in New Issue
Block a user